Results 1 to 2 of 2

Thread: Php redirect

  1. #1
    Join Date
    Mar 2011
    Posts
    2,144
    Thanks
    59
    Thanked 116 Times in 113 Posts
    Blog Entries
    4

    Default Php redirect

    Hi everyone,
    I am using a php cookie
    PHP Code:
    <?php
    if(isset($_COOKIE['lastVisit']))
        
    $visit $_COOKIE['lastVisit']; 
    else
        echo 
    "You've got some stale cookies!";

    echo 
    "Your name is "$visit;
    ?>
    from tizag.com. I would like to change it so that if the user does not have the cookie set they are redirected to a different page.
    Any help is appreciated

  2. #2
    Join Date
    Jul 2010
    Location
    Minnesota
    Posts
    256
    Thanks
    1
    Thanked 21 Times in 21 Posts

    Default

    PHP Code:
    if(isset($_COOKIE['lastVisit']))
        
    $visit $_COOKIE['lastVisit']; 
    else
        
    header('location: yourpage.php');

    echo 
    "Your name is "$visit

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •