Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post

    Cookies...Session?

    Ok, I have my index.asp page and my uc.asp page and when you open index.asp you get redirected to uc.asp. Then on the uc.asp page if you click enter it returns to the index.asp page whith index.asp?redir=no query.
    I'd like to keep that redir=no for the session so that index.asp won't redirect again.

    I've looked at a cookie and a session tutorial at w3schools but can't figure it out for myself.
    Omnis mico antequam dominus Spookster!

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Top of index.asp:

    Code:
    <%
    If Session("redir")="" then response.Redirect("uc.asp")
    %>
    Then your uc.asp:

    Code:
    <%If Request.Form("Enter")="Enter" Then
    Session("redir")="no"
    Response.Redirect("index.asp")
    End If %>
    
    <HTML>
    <HEAD>
    <TITLE>Enter Site</TITLE>
    </HEAD>
    
    <BODY>
    <p>Welcome!<BR />To enter click the button below!</p>
    
    <FORM action="uc.asp" method="Post">
    <P><INPUT type="Submit" Value="Enter"></p>
    </FORM>
    
    </BODY>
    </HTML>
    Does that do what you want?
    OracleGuy

  • #3
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    I'm not using a form though. I'm using and image with an image map. How would I go about using that?
    Omnis mico antequam dominus Spookster!

  • #4
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    I used this in the image map-
    href="uc.asp?enter=enter

    Is this a good way?
    Omnis mico antequam dominus Spookster!

  • #5
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Originally posted by oracleguy
    Top of index.asp:

    Code:
    <%
    If Session("redir")="" then response.Redirect("uc.asp")
    %>
    Then your uc.asp:

    Code:
    <%If Request.QueryString("Enter")="Enter" Then
    Session("redir")="no"
    Response.Redirect("index.asp")
    End If %>
    Note the change. And then that should work.

  • #6
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    Oh yeah, I did that but forgot to put it in my reply. Sorry.
    Thanks OracleGuy
    Omnis mico antequam dominus Spookster!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •