cookies and IF's

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • j0rdanf1
    New Member
    • Oct 2006
    • 35

    cookies and IF's

    Ok, so I thought I would try and be clever, i wanted the space which usually has the login form to change once logged in, however when I try it out nothing appears in that space. Im a tad confused, any ideas?

    Code:
    <%@LANGUAGE="VBSCRIPT"%>
    <% userid = (Request.Cookies("login1")("userid"))
    
    If userid = "" Then
    <!--#include file="welcome user.asp" -->
    else
    <!--#include file="logindex.asp" -->
    end if
    %>
  • j0rdanf1
    New Member
    • Oct 2006
    • 35

    #2
    still having trouble with this, I have no idea if its possible or not. :s

    I would have thought it would be quite simple, if the user has never logged on before thier should be no cookies recorded meaning they see the logindex.asp script in the top left, if they have logged in before the cookie should still be present and therefore load the welcome user.asp script showing their email address.

    Comment

    • CroCrew
      Recognized Expert Contributor
      • Jan 2008
      • 564

      #3
      Give this a try and let us know if it worked:

      [CODE=asp]
      <%
      If (Request.Cookie s("login1") = "") Then
      <!--#include file="welcome user.asp" -->
      Else
      <!--#include file="logindex. asp" -->
      End If
      %>
      [/CODE]

      Also, is there really a space in the files’s name “welcome user.asp”?

      Hope it works for ya~

      Comment

      Working...