set/read user preferences in/from a cookie?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
msafi
Forum Newbie
Posts: 1
Joined: Thu Dec 15, 2005 7:14 pm

set/read user preferences in/from a cookie?

Post by msafi »

hi all,

my index page has two links. one link for the arabic section of the website, and another link for the english section of the website. when a user visits the page for the first time, he's gonna have to choose a language, but i don't want him to have to choose a language everytime he visits the website. that's why i want to store his preference in a cookie, so that next time he visits, i re-direct him automatically.

can someone give me instructions on how to do that? even high-level non-technical instructions are very much appreciated.

thanks,
User avatar
hawleyjr
BeerMod
Posts: 2170
Joined: Tue Jan 13, 2004 4:58 pm
Location: Jax FL & Spokane WA USA

Post by hawleyjr »

set a cookie:

http://us2.php.net/manual/en/function.setcookie.php


when any user visits the site check to see if the cookie is set and what language it should be. :)
Post Reply