I'm trying to put a login box on the top of each page and hello username if the user logged on already, i.e. if they have a session variable. Maybe this is crazy, but I wanted to include it in each page just above my menu, so I don't have to put it on every page and for ease of changes.
Here's my code so far - it doesn't work, can someone help get me on the right track?
<%
if session("CandID"
<> "" then
Response.Write "Hello " & session("CandID"
& "!"
Response.Write "If you are not " & session("CandID"
& "please "
Response.Write "<a href='default.shtml'>log in.</a>"
end if
%>
<form action="validatePassword.asp" method="get" name="frmLogin">
<h3>Already a member? <br>Login now.</h3>
<table>
<tr>
<td>Username: </td></tr>
<tr>
<td><input id="text1" name="txtUserName"></td></tr>
<tr>
<td>Password: </td></tr>
<tr>
<td><input type="password" id="password1" name="txtPassword"></td></tr>
</table><br>
<input type="image" src="images/img_Submit.gif" value="Submit" id="submit1" name="btnSubmit" WIDTH="106" HEIGHT="54">
</form>
<h3>New User? </h3>
<a href="profile.shtml">Click Here</a>
Here's my code so far - it doesn't work, can someone help get me on the right track?
<%
if session("CandID"
Response.Write "Hello " & session("CandID"
Response.Write "If you are not " & session("CandID"
Response.Write "<a href='default.shtml'>log in.</a>"
end if
%>
<form action="validatePassword.asp" method="get" name="frmLogin">
<h3>Already a member? <br>Login now.</h3>
<table>
<tr>
<td>Username: </td></tr>
<tr>
<td><input id="text1" name="txtUserName"></td></tr>
<tr>
<td>Password: </td></tr>
<tr>
<td><input type="password" id="password1" name="txtPassword"></td></tr>
</table><br>
<input type="image" src="images/img_Submit.gif" value="Submit" id="submit1" name="btnSubmit" WIDTH="106" HEIGHT="54">
</form>
<h3>New User? </h3>
<a href="profile.shtml">Click Here</a>