Jump to content

snakeman

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

snakeman's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm only setting a cookie and changing that cookie on the main site, let's call it, main.com. So when you go back to main.com after closing your browser, you'll be directed to either sitea.com or siteb.com, the last site you were on. The code I included is on main.com and there's a form on each of the other sites that uses main.com to process the form submit choosing the other site. Does this make sense?
  2. I've placed some simple cookie handling code in a site to keep track of the last site visited between 2 choices on the main site. Here's the code in the header of the main site to check and change the cookie when the site changes. Thanks for any insights. ;-) if($_REQUEST['site'] == 'sitea'){ setcookie('location', 'sitea',time()+60*60*24*365); header("Location: http://www.sitea.com"); exit; } if($_REQUEST['site'] == 'siteb'){ setcookie('location', 'siteb',time()+60*60*24*365); header("Location: http://www.siteb.com"); exit; } if(isset($_COOKIE['location'])) { if($_COOKIE['location'] == 'sitea') { header("Location: http://www.sitea.com"); exit; } if($_COOKIE['location'] == 'siteb') { header("Location: http://www.siteb.com"); exit; } } This code seems to work in FF and Chrome as far as I can tell. Then again, it seems to work on my own computer with IE8 but does not on anyone else's computers I've asked to check it out on.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.