Dear WebDeveloper members,
First I want to greet all of you a pleasant day.
I have experiencing a problem regarding the site I’m creating. My site used a frameset, with [B]FrameTop.html[B]FrameLeft.htm[B]FrameMain.htm
The FrameLeft.htm has text fields where user can input his username and password, and of course a login button that if pressed the action will be directing to the mainframe (there is a slight use of ASP here because of a database connection). BUT, after a successful (or even unsuccessful) login, I noticed that the data on both text field is still there, and my prof wants to have it “disappear” (or cleared) every time I logged in.
Here is the code of the form in my COLOR=Green]FrameLeft.htmlCOLOR]:
<form name=”formAdmin” method=”post” action=”authenticate.asp”
target=”mainFrame”>
<strong>Username</strong>
<input maxlength=15 size=10 name=”username”>
<strong>Password</strong>
<input type=”password” size=10 name=”password”></td>
<input type=”submit” value=”Login”>
</form>
This is the code in my [COLOR=Green]authenticate.asp
<%
response.buffer = true
varusername = request.form(“username”)
varpassword = request.form(“password”)
response.write(varusername)
response.write(varpassword)
dim Conn, rs
set Conn = Server.CreateObject (“ADODB.Connection”)
Conn.open “Provider = Microsoft.jet.OLEDB.4.0;” & “Data Source = ” & Server.MapPath (“Database/MedTransDB.mdb”)
set rs = Server.createObject (“ADODB.recordset”)
rs.open “select * from TableSecurity where Username = ‘” & varusername & “‘ and Password = ‘” & varpassword & “‘” & “and Level =’1′”,Conn
if rs.eof = False and rs.bof = False then
response.redirect(“MedTransHR_function.asp”)
else
response.write(“<br>”)
response.write(“<br>”)
response.write(“<b><font color=’#FF0000′> Your username and password is invalid or does not exist.</font></b>”)
response.write(“<br>”)
response.write(“<br>”)
end if
%>
I hope you could all help me with this, I know this is a simple problem to some of you, but I just can’t get it. Thank you to all and God bless.
Best regards,
[COLOR=Blue]MarkSquall