Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

web page redirect

Status
Not open for further replies.

jen0dorf

IS-IT--Management
Apr 15, 2008
104
GB
Hi

trying to set up a cookie where the user is directed to a splash page that will show special offers

From the web I've gleaned some code so on the index.php page I added above the head

<?php
if( !(isset($_COOKIE["splashCookie"])) ) {
header("Location: }
?>

This seems to work but when I close the browser and restart it it always goes to the splash page.



On splash page I've added the code

<?php
if( !(isset($_COOKIE["splashCookie"])) ) {
setcookie("splashcookie", "visited", time()+(60*60*24*5), "/", "", 0);
}
?>

So the code is wrong somewhere.

Can someone assist?

thanks
 
variables are case sensitive. spashcookie vs splashCookie are significantly different.
 
Hi

thanks that seems to have sorted it.

cheers

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top