<% Option Explicit Dim sql,username,rsUser,rsMessages,newcount username = Request.Cookies("username") 'If the username cookie is set, they must have logged in, so get their details from the database if username <> "" then %> <% sql = "SELECT icon FROM Users WHERE username = '" & username & "'" Set rsUser = Server.CreateObject("ADODB.Recordset") rsUser.Open sql, conn, 3, 3 sql = "SELECT messageread FROM messages WHERE sendto = '" & username & "'" Set rsMessages = Server.CreateObject("ADODB.Recordset") rsMessages.Open sql, conn, 3, 3 newcount = 0 if not rsMessages.EOF then rsMessages.Movefirst do until rsMessages.EOF if rsMessages("messageread") = False then newcount = newcount + 1 end if rsMessages.Movenext loop rsMessages.Movefirst end if end if %> Homepage


<%'If they're not logged in, then display a login box if username = "" then%> <%'If they are, show a mini profile box plus a sign out link else%> <% rsUser.close set rsUser = nothing rsMessages.close set rsMessages = nothing conn.close set conn = nothing end if %>
Sign In
Username :
Password :
Remember me :

I am not a user so
sign me up!
Welcome Back!
.gif" width=50 height=50 align="right"> Welcome <%=username%>.
View/Edit Profile
My Inbox (<%=newcount%> new)
View Userlist
Sign Out

Welcome to Clickit, The online Shop!

To use the shop, You must sign up for free

You can sign up here or lust log in.

Checking the "Remember Me" checkbox ensures the user is kept logged in even when the browser is closed. Leaving this unchecked keeps you logged in only for the duration of the browser session.

Once logged in, users can use the Profile Editor to alter their stored profile.

Thanks allot, Chris Vallis!