smacks
06-21-2004, 03:05 PM
Hey guys,
I scrapped the last login page and began a newer simplier version, but I am still running into problems. I was having trouble with a 405 error, so i changed the submit button to a normal button. Although, the link works and the page is redirected to the securityloginrespond.asp page. The problem is the request.form("username") is not working properly. It will say there is no User of that name when there really is.
I think it might have something to do with the "post" vs. "get" form methods or that extra button i put there instead of a submit button. I am not sure what to do here and I couldn't be more frustrated. The code for the login page is.....
<!--#include file="include/header.inc"-->
<br>
<br>
<table>
<tr>
<!--text on the left hand side-->
<td valign=top width=300><font size=2>To access to Employee Information, BPM Hierarchies and Server Information,
Regional Information and Case Listings/Events Occurred and Activities Used</font></td>
<!--main login box with links on right-->
<td>
<table bgcolor=CCCCCC cellspacing=0 cellpadding=1 align=center>
<tr>
<td>
<form method="get">
<table bgcolor=f2f2f2 cellpadding=0 cellspacing=5>
<tr>
<td colspan=2><font size=2>Please Enter Your Username and Password to Sign In.</font><br><br></td>
</tr>
<tr>
<td align=right><font size=2>Username:</font></td>
<td align=left><input NAME="username" type=text size="20"></td>
</tr>
<tr>
<td align=right><font size=2>Password:</font></td>
<td align=left><input NAME="userpassword" type=password size="20"></td>
</tr>
<tr>
<td colspan=2 align=center>
<input type="button" onclick="window.location.href='securityloginrespond.asp'" value="Sign In">
<input type="reset"></td>
</tr></table></form>
</td>
</tr>
</table>
</td>
<td>
<ul>
<li><a href=contact.asp><font size=2>Trouble Accessing Your Account?</font></a>
<li><a href=login-lostpw.asp><font size=2>Lost Your Password?</font></a>
<li><a href=newuser.asp><font size=2>Are you a new user?</font></a>
</ul>
</center>
</td>
</tr>
</table>
<hr>
<hr>
<!--#include file="include/footer.inc"-->
AND THE CODE FOR THE SECURITYLOGINRESPOND.ASP PAGE IS BELOW
<%
myname=request.form("username")
mypassword=request.form("userpassword")
set conntemp=server.createobject("adodb.connection")
dbname="databases/users.mdb"
myconnect="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="
myconnect=myconnect & server.mappath(dbname)& ";"
conntemp.Open myconnect
sqltemp="select * from users where UserID='"
sqltemp=sqltemp & myname & "'"
set rstemp=conntemp.execute(SQLTemp)
If rstemp.eof then%>
we don't have a user named <%=Myname%> on file!<br>
Try <A href='default.asp'>Logging in</a> again
<%response.end
end if
If rstemp("Password")=mypassword then
session("name")=rstemp("UserID")
session("securitylevel")=rstemp("securitylevel")
response.write "Security Level=" & session("securitylevel")
else%>
Password Unrecognized<br>
Try <A href='default.asp'>Logging in</a> again
<%response.end
end if
rstemp.close
conntemp.close
set rstemp=nothing
set conntemp=nothing
%>
thanks for taking your time to look at this, i really do appreciate this.
I scrapped the last login page and began a newer simplier version, but I am still running into problems. I was having trouble with a 405 error, so i changed the submit button to a normal button. Although, the link works and the page is redirected to the securityloginrespond.asp page. The problem is the request.form("username") is not working properly. It will say there is no User of that name when there really is.
I think it might have something to do with the "post" vs. "get" form methods or that extra button i put there instead of a submit button. I am not sure what to do here and I couldn't be more frustrated. The code for the login page is.....
<!--#include file="include/header.inc"-->
<br>
<br>
<table>
<tr>
<!--text on the left hand side-->
<td valign=top width=300><font size=2>To access to Employee Information, BPM Hierarchies and Server Information,
Regional Information and Case Listings/Events Occurred and Activities Used</font></td>
<!--main login box with links on right-->
<td>
<table bgcolor=CCCCCC cellspacing=0 cellpadding=1 align=center>
<tr>
<td>
<form method="get">
<table bgcolor=f2f2f2 cellpadding=0 cellspacing=5>
<tr>
<td colspan=2><font size=2>Please Enter Your Username and Password to Sign In.</font><br><br></td>
</tr>
<tr>
<td align=right><font size=2>Username:</font></td>
<td align=left><input NAME="username" type=text size="20"></td>
</tr>
<tr>
<td align=right><font size=2>Password:</font></td>
<td align=left><input NAME="userpassword" type=password size="20"></td>
</tr>
<tr>
<td colspan=2 align=center>
<input type="button" onclick="window.location.href='securityloginrespond.asp'" value="Sign In">
<input type="reset"></td>
</tr></table></form>
</td>
</tr>
</table>
</td>
<td>
<ul>
<li><a href=contact.asp><font size=2>Trouble Accessing Your Account?</font></a>
<li><a href=login-lostpw.asp><font size=2>Lost Your Password?</font></a>
<li><a href=newuser.asp><font size=2>Are you a new user?</font></a>
</ul>
</center>
</td>
</tr>
</table>
<hr>
<hr>
<!--#include file="include/footer.inc"-->
AND THE CODE FOR THE SECURITYLOGINRESPOND.ASP PAGE IS BELOW
<%
myname=request.form("username")
mypassword=request.form("userpassword")
set conntemp=server.createobject("adodb.connection")
dbname="databases/users.mdb"
myconnect="PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE="
myconnect=myconnect & server.mappath(dbname)& ";"
conntemp.Open myconnect
sqltemp="select * from users where UserID='"
sqltemp=sqltemp & myname & "'"
set rstemp=conntemp.execute(SQLTemp)
If rstemp.eof then%>
we don't have a user named <%=Myname%> on file!<br>
Try <A href='default.asp'>Logging in</a> again
<%response.end
end if
If rstemp("Password")=mypassword then
session("name")=rstemp("UserID")
session("securitylevel")=rstemp("securitylevel")
response.write "Security Level=" & session("securitylevel")
else%>
Password Unrecognized<br>
Try <A href='default.asp'>Logging in</a> again
<%response.end
end if
rstemp.close
conntemp.close
set rstemp=nothing
set conntemp=nothing
%>
thanks for taking your time to look at this, i really do appreciate this.