PDA

View Full Version : Logging in display


rico1931
08-19-2008, 03:16 PM
Hi there I was just wondering what would be the best way to write an if then statement that will display the link to log in when nothing is stored in the cookie 'Auth_email' and vice versa when there is something in the cookie.

Thanks for the help!


<div align="center"><span class="style1"><a href="/AUTH_LogIn.asp">Log In</a>
</span><br />

<br />
Welcome <%=cStr(Request.Cookies("Auth_Email"))%>
<br />
Not you? <a href="/AUTH_LogOut.asp">Log Out</a><br />
User's Current Level: <%=cStr(Request.Cookies("Auth_Level"))%><br />
</div>

rico1931
08-19-2008, 04:56 PM
ok so i figured it half out


<div align="center">Welcome
<% If Request.Cookies("Auth_Email") <> "" Then
%>
<%=cStr(Request.Cookies("Auth_Email"))%>


<br /> Not you? <a href="/AUTH_LogOut.asp">Log Out</a><br />
User's Current Level: <%=cStr(Request.Cookies("Auth_Level"))%><br />
<%
End If
%>
<br />

<span class="style1"><a href="/AUTH_LogIn.asp">Log In</a></span><br />



</div>


now I just need to find a way so this

<span class="style1"><a href="/AUTH_LogIn.asp">Log In</a></span><br />


Will only show up if nothing is withing Request.Cookies ... any clue? I tried >< haha hoping it would work opposite but it didn't haha.

Thanks!

davidj
08-19-2008, 05:06 PM
im not an asp'er but is this not correct


<%

If Request.Cookies("Auth_Email") = ""

Then

%>

<span class="style1"><a href="/AUTH_LogIn.asp">Log In</a></span><br />

<%

End If

%>

rico1931
08-19-2008, 05:52 PM
im not an asp'er but is this not correct


<%

If Request.Cookies("Auth_Email") = ""

Then

%>

<span class="style1"><a href="/AUTH_LogIn.asp">Log In</a></span><br />

<%

End If

%>

And again Davidj is the hero! haha thanks and for now on i'll post my asp questions in the asp portion of the forum! Thanks

davidj
08-19-2008, 07:44 PM
asp is evil

it fell out of the devils anus

not to be too negative though

rico1931
08-19-2008, 07:46 PM
hahaha.... i know i know.. next web project i'll tell them that we need to move to php promise!