I am trying to create a login screen on my main page which is broken up into 4 frames. Something you see a lot of these days. I believe I have the script to have them login but after they have successful done so I want to hide the text boxes and display something that lets them know they are now logged in. How do I do that? Maybe even a welcome and the user's name (user_name).
<%Response.Buffer = TRUE %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY bgColor=#a8a8a8>
<%
session.timeout=20
' Check if the page has been submitted
strusername = Request.ServerVariables("A
UTH_USER")
Y = instr(strusername, "\")
x = len(strusername)
x = x - Y
strusername = right(strusername, x)
if request("username")<>"" OR request("password")<>"" then
Set rs = Server.CreateObject("ADODB
.Recordset
")
strSQL = "SELECT * FROM registration WHERE user_name='" & replace(Request("username"
),"'","''"
) & "' and password='" & replace(Request("password"
),"'","''"
) & "'"
rs.open strsql, "DSN=FDS_Analogs"
if request("username")= "ho0ctr" and request("password") = "crw" then
' Username and Password match found in database
session("loggedin")="True"
' You only need these two next sessions if use the username
' or password somewhere else in the site
session("username")=rs("us
er_name")
session("password")=rs("pa
ssword")
rs.Close
'rs = nothing
response.redirect request("url")
else
if rs.eof or rs.bof then
' No match found
response.write "<FONT color=blue><STRONG>The user name or password you entered are not valid. Please ensure all information was entered in correctly.</strong></font>
"
else
' Username and Password match found in database
session("loggedin")="True"
' You only need these two next sessions if use the username
' or password somewhere else in the site
session("username")=rs("us
er_name")
session("password")=rs("pa
ssword")
rs.Close
'rs = nothing
response.redirect request("url")
end if
end if
end if
%>
<form action="Ext_FARHOME_Left_S
idebar.asp
" method=post name=frmPassword>
<table border="0" bordercolor="#000000" cellpadding="0" cellspacing="0" style="border-right: gray thin;
border-top: gray thin; border-left: gray thin; width: 100%; border-bottom: gray thin;
height: 10%; text-align: center">
<tr>
<td bgcolor="#000000" style="width: 378px; color: black; height: 33px; background-color: firebrick;
text-align: left">
<strong><span style="color: white"> Login</span></strong></td>
</tr>
<tr>
<td bgcolor="#000000" style="width: 378px; color: black; height: 166px; background-color: transparent;
text-align: left">
<span style="font-size: 8pt; font-family: Trebuchet MS"> Enter your ID:<br />
</span> <INPUT id=Text1 name=username value=<%Response.write strusername%>><br />
<br />
<span style="font-size: 8pt; font-family: Trebuchet MS"> Enter Password:<br />
</span> <INPUT name=password type=password><br />
<input type="submit" name="btnSubmit" value="Login"><br />
<br />
<a href="javascript:openIEWin
('Ext_FARH
OME_Regist
rationPage
.asp')" style="width: 170px;
color: #ffffff; border-top-style: none; border-right-style: none; border-left-style: none;
border-bottom-style: none"><font color="black" face="Trebuchet MS" onmouseout="this.style.col
or = 'Black'"
onmouseover="this.style.co
lor = 'Red'" size="2"><span>Click to request access to Area
Research documents.</span></font></
a></td>
</tr>
</table>
<p style="text-align: center">
<table border="0" bordercolor="#000000" cellpadding="0" cellspacing="0" style="border-right: gray thin;
border-top: gray thin solid; border-left: gray thin; width: 100%; border-bottom: gray thin solid;
height: 5%; text-align: center">
<tr>
<td bgcolor="#000000" style="width: 378px; color: white; height: 33px; background-color: firebrick;
text-align: left">
<strong> General Information</strong></td>
</tr>
<tr>
<td bgcolor="#000000" style="width: 378px; color: black; height: 67px; background-color: transparent;
text-align: left">
<a href="javascript:openPDFWi
n('Mission
Statement.pdf')" style="color: #ffffff;
border-top-style: none; border-right-style: none; border-left-style: none; border-bottom-style: none">
<font color="black" face="Trebuchet MS" onmouseout="this.style.col
or = 'Black'" onmouseover="this.style.co
lor = 'Red'"
size="2"><span>Mission Statement</span></font></a
>
<br />
<a href="javascript:openIEWin
('AR_docum
entation/K
aren Hoguet Presentation April 2007.ppt')"
style="color: #ffffff; border-top-style: none; border-right-style: none; border-left-style: none;
border-bottom-style: none"><font color="black" face="Trebuchet MS" onmouseout="this.style.col
or = 'Black'"
onmouseover="this.style.co
lor = 'Red'" size="2"><span>AR Presentation 4-9-07</span></font></a></
td>
</tr>
</table>
</p>
</form>
</BODY>
</HTML>
Start Free Trial