www.webdeveloper.com
Results 1 to 2 of 2

Thread: [RESOLVED] cookie question

  1. #1
    Join Date
    Apr 2007
    Posts
    209

    resolved [RESOLVED] cookie question

    Hello, I'm getting an error message saying it doesn't like the first bracket {
    can anyone see why? This is just supposed to show "text 1" on one page load and then "text 2" on the next, then repeat.

    PHP Code:
    <?php
    setcookie
    ("a"$thistime()+60*60*24*180);
    $this "text 1";
    $that "text 2";
    if(isset(
    $_COOKIE['a']){setcookie("b"$thattime()+60*60*24*180);}
    echo 
    $this
    else if(isset(
    $_COOKIE["b"]){setcookie("a"$thistime()+60*60*24*180);}
    echo 
    $that;
    ?>

  2. #2
    Join Date
    Jun 2003
    Location
    here
    Posts
    4,551
    you open 2 brackets(1 for the if, one for the isset), and only close 1.

    you actualy do this twice, once for each if...
    If you are using PHP please use the [PHP] and [/PHP] forum tags for highlighting...
    The same applies to HTML and the forums [HTML][/HTML] tags.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles