PDA

View Full Version : Checkbox and cookies


Charl
10-26-2004, 02:02 PM
Hey,

I am trying to setup something similar to

http://www.expedia.com/daily/splash/GB.asp?ocntry=GB&conf=99&ckie=True&index=0

Where a cookie is set when the checkbox and url are selected. Setting a normal cookie is easy enough but i'm stuck on this.

trib4lmaniac
10-26-2004, 02:05 PM
On the page that you may want to bypass, put at the very top (or near the top before any text has been sent)...
<?
if(isset($_COOKIE['location']) && $_COOKIE['location'] == 'UK') {
header('Location: http://www.mysite.com/en/');
}
?>
or at least something similar.

Charl
10-26-2004, 02:38 PM
Okay thanks, so that code goes on the two seperate domains, just the url is changed and then how do i set a cookie to remember which url has been visited?

marek_mar
10-26-2004, 03:23 PM
http://www.php.net/setcookie

trib4lmaniac
10-26-2004, 03:29 PM
Oh, sorry I misread your forst post. Thought you said you'd already done the cookie bit. Here's a basic version of what you'd need to do (attachment).