Page 1 of 1

[Solved]Php with Cookies, Help Please

Posted: Sun Feb 29, 2004 6:40 pm
by kaYak
The homepage of my site is a page in 6 different languages that says "Welcome to our site. Please select your language." I have all of these flags for different languages to enter my site in. I am using Google to have the pages translated through frames. Well, anyway, what I want it to do is when they select their language it will set a cookie to remember their language so the next time they come to the homepage it will forward them to a different page depending on their language. Can someone please help me with this. :D

Thanks,
techguy

Posted: Tue Mar 02, 2004 5:53 pm
by ckuipers

Code: Select all

setcookie ("CookieName", CookieValue, time()+1209600);
This sets the cookie. You basically do this when the language is changed.

Code: Select all

if (isset ($HTTP_COOKIE_VARSї"CookieName"]))
{
redirect to page using language
}
else stay on default page
On every page read cookie to decide what language to use

Hope this helps.

Re: Php with Cookies, Help Please

Posted: Wed Mar 03, 2004 2:58 am
by Dr Evil
techguy wrote:I am using Google to have the pages translated through frames.
I work on lots of multilanguage sites and google certainly doesn't seem to me a very wise solution for translation. You give off a cheap image this way, as google is more than approximative !