Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy login.php grrrrrrrrrrrr

    hihi, im having this problem with my login script, i found a few errors in it which ive managed to sort out, but now when i try to login i get greeted with this error
    Parse error: parse error, unexpected $ in /usr/home/urbanregress/public_html/league/login.php on line 160
    Pleaseeeeeeeee can someone help me try and work out where im going wrong ... to view the srcipt click here
    login.php ... Obviously the real script is in .php format i have just copied it and placed it in .txt for easy viewing.

  • #2
    New to the CF scene
    Join Date
    Jul 2002
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    After quite abit of digging i found the problem to be in here somewhere,

    function cookie_crisp($cname, $cvalue, $ccode, $cexpire){
    global $timeout;

    if(($cname) && ($cvalue)){
    setcookie("$cname");
    if($ccode){
    $cvalue=base64_encode($cvalue);
    }
    if(!$cexpire){
    $cexpire=(time()+$timeout[cookie]);
    }
    if($cexpire=="never"){
    $cexpire=(time()+60*60*24*365);
    }
    if($cexpire=="session"){
    $cexpire="";
    }
    $cpath="/";
    $cdomain="";
    setcookie("$cname","$cvalue","$cexpire","$cpath","$cdomain");
    }
    i no longer get any kind of error, but my problem now is that i cant seem to login, prolly coz this part is to do with the cookies but i cant see where i gotta fit the } into pleaseeeeee help

  • #3
    Super Moderator
    Join Date
    May 2002
    Location
    Perth Australia
    Posts
    4,040
    Thanks
    10
    Thanked 92 Times in 90 Posts
    your code above is missing a trailing '}' so the last line should be '}}'

    as to whether that solves the cookie setting problem its hard to say!
    resistance is...

    MVC is the current buzz in web application architectures. It comes from event-driven desktop application design and doesn't fit into web application design very well. But luckily nobody really knows what MVC means, so we can call our presentation layer separation mechanism MVC and move on. (Rasmus Lerdorf)

  • #4
    New Coder
    Join Date
    Jun 2002
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I have run into many many cookie issues, especially when it comes to cookie setting in a function what I have found to work really well is using this in my code:


    ob_start();

    setcookie("cookie");

    ob_end_flush();

    what the ob_start(); does is stop the execution of all headers and essentially puts the code that follows it as the first code to execute. Since cookies are supposed to be the put before any other code, and I know sometimes you can't do that, this works nicely. The ob_end_flush(); obviously ends the ob_start();

    I hope this helps you or others with these kinds of issues.


  •  

    Posting Permissions

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