Solved

How to remember the last website I visited

Posted on 2004-09-14
10
301 Views
Last Modified: 2011-09-20
Hi, Experts,
I have this question, I have two websites, one is english version and another one is other language version. A user will come to my english site first, if this user want to visit the " other language" site, this user click a link to the " other language" website. How can I write a script which will remember this user's very last visit ( which is the " other language" site ) and not to my english site. Is it about cookie ?

Sincerely,
0
Comment
Question by:mingchih
  • 4
  • 4
  • 2
10 Comments
 
LVL 33

Expert Comment

by:sajuks
ID: 12052644
You need a cookie to store his/her preferences.
When the user enters the url again you can read from the cookie his preference and redirect to the appropriate page
0
 
LVL 5

Expert Comment

by:webtrans
ID: 12052648
yes it would be about cookies for sure
and you can make it in JS or ASP or PHP
whatever is best for you
which would you prefer
i can send u any sample
0
 

Author Comment

by:mingchih
ID: 12052651
i would like JS. or ASP ? what is the difference ?

thanks
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 5

Expert Comment

by:webtrans
ID: 12052660
asp would be using
response.cookies("cookiename") to write the cookie
and request.cookies("cookiename") to read the cookie
then a response.redirect to move him to the folder you like or even server.transfere
refere to this for more info
http://www.w3schools.com/asp/asp_cookies.asp
0
 

Author Comment

by:mingchih
ID: 12052730
I am not very good at it, could you kindly provide a sample script ?

thanks
0
 
LVL 33

Accepted Solution

by:
sajuks earned 500 total points
ID: 12052737
0
 

Author Comment

by:mingchih
ID: 12052745
this is great, thanks
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12052754
Thanks for the points and grade.
0
 

Author Comment

by:mingchih
ID: 12052793
one last Q, I saw the code
<html>
<head>
<script language="JavaScript" src="cookieLibrary.js"></script>
<script language="JavaScript">
// check to see if cookie exists
// if yes, redirect to language page
if (GetCookie("lang") == "EN")

Do I need to download "cookieLibrary.js" ?
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12052850
Yes the cookie script can be obtained from
http://www.cookiecentral.com/code/cookie.txt ( save it as the .js file )
or you can take it from
http://javascript.internet.com/cookies/name.html
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to create and access 2-dimensional arrays in JavaScript.  It includes a tutorial in case you are just trying to "get your head wrapped around" the concept and we'll also look at some useful tips for more advanced programmers. …
This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question