Cookies would be ideal for such a situation. Just write down the location id and then redirect it next time!
// store an array of location cookie names and there location values $places = array('us'=>'/united-states.php'); // After user chooses a location, store the cookie based on his choice: in this case, us! setcookie('location','us', time() + (3600 * 24 * 7)); // On a new page check the cookie is set, if it is then redirect users to the value of that cookie name in the array! if(isset($_COOKIE['location'])){ header('Location: '.$places[$_COOKIE['location']]); }
source share