I have a website which contains the root directory, a MemberPages directory and a PublicPages directory.
Default.aspx resides in the root directory and includes a javascript login. Upon clicking the Login button the user should be directed to a page within the MemberPages directory. I had this working, however added a new user last night and since then no logins are working. We are in progress on building a fully secure site with SQL Db however until that is complete I need to get this login script working again.
When a user clicks on login the site tries to load the MemberPages page from the root directory. I am looking for some assistance as to how I get it to load the page from the MembersPages directory. I have had to shut part of the site down until this is fixed. I did have it working but in my stupidity I accidentally saved over the code and as I wrote in earlier in the year I have forgotten what it is I did to get it to work.
Code from Default.aspx below. The login button should take the user to ~/MemberPages/BrkrDflt.aspx
Any assistance would be GREATLY appreciated.
Default.aspx resides in the root directory and includes a javascript login. Upon clicking the Login button the user should be directed to a page within the MemberPages directory. I had this working, however added a new user last night and since then no logins are working. We are in progress on building a fully secure site with SQL Db however until that is complete I need to get this login script working again.
When a user clicks on login the site tries to load the MemberPages page from the root directory. I am looking for some assistance as to how I get it to load the page from the MembersPages directory. I have had to shut part of the site down until this is fixed. I did have it working but in my stupidity I accidentally saved over the code and as I wrote in earlier in the year I have forgotten what it is I did to get it to work.
Code from Default.aspx below. The login button should take the user to ~/MemberPages/BrkrDflt.aspx
Any assistance would be GREATLY appreciated.
Code:
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
Title="Home Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<!--
CONTENT CONTAINER
-->
<div id="content-container-two-column"
<span style="font-family: Verdana">
<!--
CONTENT MAIN COLUMN
-->
</span>
<div id="content-main-two-column">
<h1 style="font-family: Verdana">
WELCOME</h1>
<div id="three-column-container"
style="background-image: url('Images/Image1.png'); width: 696px;">
<div id="three-column-side1">
<img alt="" class="photo-border" src="Images/CrctBrd.png"
style="height: 78px; width: 144px; font-family: Verdana;" />
<h2 style="font-family: Verdana">
Our Products</h2>
<p>
<span style="font-family: Verdana">
<span style="font-weight: normal">We provide speciality insurance on the</span>
<span style="font-weight: normal">following</span> <span style="font-weight: normal">products</span>:</p>
<p>
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/Motor.aspx" Font-Bold="true">> Prestige Motor Vehicle</asp:HyperLink>
</p>
<p>
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl="~/BPK.aspx"
Font-Bold="True">> Business Package</asp:HyperLink>
</p>
<p>
<asp:HyperLink ID="HyperLink3" runat="server" NavigateUrl="~/ISR.aspx"
Font-Bold="True">> Industrial Special Risks</asp:HyperLink>
</p>
<p>
<asp:HyperLink ID="HyperLink4" runat="server" NavigateUrl="~/PLB.aspx"
Font-Bold="True">> Broadform Liability</asp:HyperLink>
</div>
<div id="three-column-side2">
<img alt="" class="photo-border" src="Images/Calc.png"
style="height: 78px; width: 144px" /></span>
<h2 style="font-family: Verdana">
Members Area</h2>
<table border="0" cellpadding="3" height="166" style="width: 201px">
<tr>
<td colspan="3" style="text-align: left">
Please select your Username and enter your password to access.
</td>
</tr>
<tr>
<td class="style22" height="34">
</td>
<td class="style21">
<span class="style19">Username:</span></td>
<td class="style23">
<div align="left">
<span class="style19">
<select name=memlist>
<option value='x'>
<option value='TPUA001|22896|KSNSLGLT'>TPUA001
<option value='TPUA002|11718|CXKSLGLT'>TPUA002
<option value='TPUA003|8073|DSPSLGLT'>TPUA003
<option value='TPUA004|60588|DSSSEFLT'>TPUA004
<option value='TPUA005|6615|CTPSLGLT'>TPUA005
<option value='TPUA006|34560|CSNXENMT'>TPUA006
<option value='TPUA007|38934|CWMWENMT'>TPUA007
<option value='TPUA008|21924|ERKSLGLT'>TPUA008
<option value='TPUA009|40257|CSLSLGLT'>TPUA009
</select>
</span>
</div>
</td>
</tr>
<tr>
<td class="style22" height="35">
</td>
<td class="style21" height="35">
<span class="style19">Password:</span></td>
<td class="style23">
<div align="left">
<input maxlength="8" name="pass" size="10" type="password" />
</div>
</td>
</tr>
<tr>
<td align="center" class="style22" height="34">
</td>
<td align="center" class="style21">
</td>
<td align="center" class="style23">
<div align="left">
<input class="style15" name="button" onclick="check(this.form)" type="button"
value="Login"/>
</div>
</td>
</tr>
</table>
<span style="font-family: Verdana">
<asp:HyperLink ID="HyperLink6" runat="server"
NavigateUrl="~/PublicPages/Apply.aspx" Font-Bold="True"
>> Apply for a Log In</asp:HyperLink>
<br />
<br />
<asp:HyperLink ID="HyperLink5" runat="server"
NavigateUrl="~/ForgotPassword.aspx" Font-Bold="True"
Width="206px">> Forgotten your password?</asp:HyperLink>
<br />
<br />
</div>
<div id="three-column-middle">
<img alt="" class="photo-border" src="Images/Factory.png"
style="height: 78px; width: 144px" /></span>
<h2 style="font-family: Verdana">
About Us</h2>
<p>
<span style="font-weight: normal; font-family: Verdana;">Trinity Pacific acts purely as a wholesale underwriting agency providing
services on general insurance products. We do not deal with the direct public
and only source business from licensed, general insurance brokers.</span><span
style="font-family: Verdana"> </p>
<p>
<asp:HyperLink ID="HyperLink7" runat="server"
NavigateUrl="~/About.aspx">> Read More</asp:HyperLink>
</p>
</div>
</div>
</div>
<!--
CONTENT SIDE COLUMN
-->
</span>
</div>
<script language="JavaScript">
<!-- Begin
var params = new Array(4);
var alpha = "ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI";
function check(form) {
which = form.memlist.selectedIndex;
choice = form.memlist.options[which].value + "|";
if (choice == "x|") {
alert("Please Select Your User Name From The List");
return;
}
p = 0;
for (i = 0; i < 3; i++) {
a = choice.indexOf("|", p);
params[i] = choice.substring(a, p);
p = a + 1;
}
h1 = makehash(form.pass.value, 3);
h2 = makehash(form.pass.value, 10) + " ";
if (h1 != params[1]) {
alert("Incorrect Password!"); return;
};
var page = "";
for (var i = 0; i < 8; i++) {
letter = params[2].substring(i, i + 1)
ul = letter.toUpperCase();
a = alpha.indexOf(ul, 0);
a -= (h2.substring(i, i + 1) * 1);
if (a < 0) a += 26;
page += alpha.substring(a, a + 1);
};
top.location = page.toLowerCase() + ".aspx";
}
function makehash(pw, mult) {
pass = pw.toUpperCase();
hash = 0;
for (i = 0; i < 8; i++) {
letter = pass.substring(i, i + 1);
c = alpha.indexOf(letter, 0) + 1;
hash = hash * mult + c;
}
return (hash);
}
// End -->
</script>
</asp:Content>
Comment