SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: PHP Cookies

  1. #1
    SitePoint Addict
    Join Date
    Mar 2002
    Location
    Miami, Florida - Caracas, Venezuela
    Posts
    379
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP Cookies

    Does anyone know why this:
    Code:
    //Set vehicle cookie variables if they are sent
    if(isset($HTTP_POST_VARS['year'])){
     $yr = $HTTP_POST_VARS['year'];
     setcookie('yr',$yr,time()+60*60*24*30,'');
     setcookie('mk','',time()+60*60*24*30,'');
     setcookie('md','',time()+60*60*24*30,'');
     header ("Location: " . $PHP_SELF);
    }
    if(isset($HTTP_POST_VARS['make'])){
     $mk = $HTTP_POST_VARS['make'];
     setcookie('mk',$mk,time()+60*60*24*30,'');
     setcookie('md','',time()+60*60*24*30,'');
     header ("Location: " . $PHP_SELF);
    }
    if(isset($HTTP_POST_VARS['model'])){
     $md = $HTTP_POST_VARS['model'];
     setcookie('md',$md,time()+60*60*24*30,'');
     header ("Location: " . $PHP_SELF);
    }
    ?>
    Works on our homepage but not on the rest of the pages?

    Thank you,
    Luis

  2. #2
    ********* Genius Mike's Avatar
    Join Date
    Apr 2001
    Location
    Canada
    Posts
    5,458
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    header(location) needs to be a full URL, not just the filename.
    Mike
    It's not who I am underneath, but what I do that defines me.

  3. #3
    SitePoint Addict CeleronXL's Avatar
    Join Date
    Dec 2002
    Location
    United States of America
    Posts
    349
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by naramation
    header(location) needs to be a full URL, not just the filename.
    Are you sure..?

    Yep, it appears as though you're right..


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
  •