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 5 of 5
  1. #1
    Banned
    Join Date
    Mar 2007
    Posts
    1,523
    Thanks
    116
    Thanked 0 Times in 0 Posts

    Question Login script error

    Parse error: syntax error, unexpected T_VARIABLE line 11:

    PHP Code:
    $qry="SELECT rsUser,rsBikeman,rsBikemod,rsBikeyear,rsBikecolor,rsDatetaken,rsLocation,rsLocpostcode,rsOtherinfo FROM wmb_members WHERE rsUser = '$_SESSION['RSUSER']'"
    my function to check
    PHP Code:
    function checkPass($login$password) {
        
        global 
    $link;

        
    $query="SELECT rsUser, rsPass FROM wmb_members WHERE rsUser='$login' and rsPass='$password'";
        
    $result=mysql_query($query$link)
            or die(
    "checkPass fatal error: ".mysql_error());

        
    // Check exactly one row is found:
        
    if(mysql_num_rows($result)==1) {
            
    $row=mysql_fetch_array($result);
            return 
    $row;
        }
        
    //Bad Login:
        
    return false;

    function 
    cleanMemberSession($login$password) {
        
        
    $_SESSION["RSUSER"]=$login;
        
    $_SESSION["RSPASS"]=$password;
        
    $_SESSION["loggedIn"]=true;


  • #2
    Banned
    Join Date
    Mar 2007
    Posts
    1,523
    Thanks
    116
    Thanked 0 Times in 0 Posts
    does anyone have a better login script?

  • #3
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    This resolution is wrong, arrays are advanced datatypes: '$_SESSION['RSUSER']'.
    That needs to either be broken have the strings concatenated, or forced for variable expansion using '{$_SESSION['RSUSER']}' instead.

  • #4
    Banned
    Join Date
    Mar 2007
    Posts
    1,523
    Thanks
    116
    Thanked 0 Times in 0 Posts
    I don't understand?!

  • #5
    Senior Coder
    Join Date
    Jul 2009
    Location
    South Yorkshire, England
    Posts
    2,318
    Thanks
    6
    Thanked 304 Times in 303 Posts
    Code:
    $qry="SELECT rsUser,rsBikeman,rsBikemod,rsBikeyear,rsBikecolor,rsDatetaken,rsLocation,rsLocpostcode,rsOtherinfo FROM wmb_members WHERE rsUser = '{$_SESSION['RSUSER']}'";
    or:

    Code:
    $qry="SELECT rsUser,rsBikeman,rsBikemod,rsBikeyear,rsBikecolor,rsDatetaken,rsLocation,rsLocpostcode,rsOtherinfo FROM wmb_members WHERE rsUser = '".$_SESSION['RSUSER']."'";


  •  

    Posting Permissions

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