Results 1 to 12 of 12

Thread: PHP Cookie Help

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Feb 2002
    Location
    USA
    Posts
    432

    PHP Cookie Help

    hello got this php script i wrote to diplay stuff depending on the cookie value but getting errors on the setcookie anyone know why or can improve on the code please doo

    PHP Code:
    <?php
    if($_GET['CIEC'] == 3)
    {
        
    $TWO "2";
        
    setcookie("ShowOrHide",$TWO);
    }
    else
    {
     if (isset(
    $_COOKIE["ShowOrHide"]) AND $_COOKIE["ShowOrHide"] == "1")
     {
         echo 
    "<a href=\"index.php?CIEC=3\">Close</a>";
     }
     else if(isset(
    $_COOKIE["ShowOrHide"]) AND $_COOKIE["ShowOrHide"] == "2")
     {
         
    //Do Nothing
     
    }
     else
     {
         
    $ONE "1";
        
    setcookie("ShowOrHide"$ONE);
        echo 
    "<a href=\"index.php?CIEC=3\">Close</a>";
        echo 
    "<a id=\"tooCool\" href=\"http://www.w3.com/\"></a>";
     }
    }
    ?>
    Last edited by 308holes; Dec 6th, 2005 at 12:12 PM. Reason: code fix

Posting Permissions

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



Click Here to Expand Forum to Full Width