...

View Full Version : Cookies...Session?



Mhtml
07-28-2002, 03:31 AM
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.:(

oracleguy
07-28-2002, 04:22 AM
Top of index.asp:



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


Then your uc.asp:



<%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?

Mhtml
07-28-2002, 04:27 AM
I'm not using a form though. I'm using and image with an image map. How would I go about using that?

Mhtml
07-28-2002, 04:40 AM
I used this in the image map-
href="uc.asp?enter=enter
Is this a good way?

oracleguy
07-28-2002, 04:56 AM
Originally posted by oracleguy
Top of index.asp:



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


Then your uc.asp:



<%If Request.QueryString("Enter")="Enter" Then
Session("redir")="no"
Response.Redirect("index.asp")
End If %>




Note the change. And then that should work.

Mhtml
07-28-2002, 05:09 AM
Oh yeah, I did that but forgot to put it in my reply. Sorry.
Thanks OracleGuy



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum