#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    35
    Rep Power
    15
    I have two functions, when I test them, an error occued :
    Warning: unexpected regex error (14) in ./funlib.php on line 52


    # get email from cookie
    function get_email_from_cookie() {
    global $COOKIE;
    list($email,$password) = split("|",$COOKIE); //<-line 52 here
    return $email;
    }
    /***************************************************
    * FUNCTIONS
    * - set_inp_cookie($email) set the cookie of
    that inp
    ***************************************************/
    function set_inp_cookie($email,$md5password) {
    $COOKIE = $email."|".$md5password;
    setcookie("COOKIE",$COOKIE,time()+3600);
    }

    But I known't know why.
    thankx help me

    ------------------
    Good Good Study
    Day Day Up
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    41
    Rep Power
    15
    Why so much work to get a variable from the cookie?

    Just do this:

    $cookie = $HTTP_COOKIE_VARS;

    And assuming you named the cookie email, use:

    $cookie[email]

    Much easier, isn't it.

  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2000
    Posts
    35
    Rep Power
    15
    Quite clear.... thanks

    But when I replace split() with explode(), everything goes ok.

    Why split() here don't work?

Similar Threads

  1. Codepupil
    By Adachic in forum C Programming
    Replies: 3
    Last Post: February 6th, 2004, 06:50 PM
  2. syntax error : identifer 'Hole'
    By bootrecker in forum C Programming
    Replies: 2
    Last Post: February 2nd, 2004, 08:08 AM
  3. Replies: 4
    Last Post: January 28th, 2004, 08:29 AM
  4. mysql: getting error description from error code
    By laker in forum PHP Development
    Replies: 1
    Last Post: January 21st, 2004, 06:03 AM
  5. I don't know what this error message means
    By lcham02 in forum Java Help
    Replies: 2
    Last Post: January 13th, 2004, 11:57 AM

IMN logo majestic logo threadwatch logo seochat tools logo