Printer Friendly Version Print this thread
Email this thread to a friend eMail this thread to a friend
Featured Web Site Template

Hundreds More at Free Site Templates.com!

Web Site Partners
Sponsored Links
Jet City Software
 
Whos Here ?
There are 0 guests and 1 members in the forums right now.
Reflects user activity within the last 5 minutes
Moderator(s): g1smd
Member Message

davidlieb
Joined: Nov 03, 2001
# Posts: 17

View the profile for davidlieb Send davidlieb a private message

Posted: 2001-Dec-06 07:28
Edit Message Delete Message Reply to this message

Hello!

Does anyone know a script that will set a cookie and re-route visitors if they've been there before? I'm trying to build a Flash site intro, but don't want to make people use it more than once!

Thanks!



aibob
Joined: Dec 14, 2001
# Posts: 30

View the profile for aibob Send aibob a private message

Posted: 2001-Dec-14 14:43
Edit Message Delete Message Reply to this message

I can't provide you with a "script" because most people refer to CGI scripts. I use ASP (Active Server Pages) to write websites.

Let me tell you how I do this. I have a web host that hosts multiple domains but all point to the same place. So my default.asp pages gets the value in the server variable SERVER_NAME and parses the domain out. It is then a bunch of if then statements that says if it's this domain redirect it to his directory/default.asp.

But for one site if they are logged in I don't want to send them to directory/deafult.asp but directory/member_default.asp.

Here is a snippet of my asp code. I've replaced my domain with an x.com so the admins won't change it.

<%@Language=VBScript%>
<% Option Explicit %>
<%
Dim sServerName, iLoc, iCookieZipCode, sDomain, sSubDomain

sServerName = LCase(Trim(Request.ServerVariables("SERVER_NAME")))

If ( sServerName = "www.x.com" Or sServerName = "x.com" ) Then
' If they are a user with a user id then send them to the member default page
If IsNumeric(Request.Cookies("Session")("LUserID")) = True And Request.Cookies("Session")("LUserID") > 0 Then
Response.Redirect("http://www.x.com/bb/Member_Default.asp")
Else
Response.Redirect("http://www.x.com/bb/default.asp")
End If
End If
%>






Sinoed
Joined: Dec 11, 2000
# Posts: 5266

View the profile for Sinoed Send Sinoed a private message

Posted: 2001-Dec-23 04:01
Edit Message Delete Message Reply to this message

Use this very carefully. I went to movie reviews site (something like AMC or famout players - I can't remember) just a few days ago which automatically forwarded me to the "Canadian" version - which happened to not load at all. Any time I tried to access the site this happened and I finally gave up and skipped it entirely. I ended up seeing a movie at another theatre because I couldn't get the information that I wanted. If you're going to do this at the very least provide links to switch back to the page(s) of your visitors choice.


You are not permitted to post messages in this forum or topic, because of one or more of the following reasons:
  1. You have not yet logged in, or registered properly as a member
  2. You are a member, but no longer have posting rights.
  3. This is a private forum, for which you do not have permissions.

If you are a recent member, it's possible that you simply have not yet confirmed your account. Please check your email for a message entitled 'JimWorld Forums: Confirm Your Account' and follow the instructions contained within.

If you cannot find this message, click here to Re-Send it.

If you are still experiencing problem, please read the Login Assistance Article for some advice on what may be causing your login not to work properly.

Switch to Advanced Editor and ... Create a New Topic or Reply to this Thread

New posts Forum is locked
© 1995  ·  iWeb, Inc  ·  DBA JimWorld Productions