...

View Full Version : Login script error



jarv
05-31-2011, 06:44 PM
Parse error: syntax error, unexpected T_VARIABLE line 11:



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


my function to check


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;
}

jarv
05-31-2011, 06:46 PM
does anyone have a better login script?

Fou-Lu
05-31-2011, 06:48 PM
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.

jarv
05-31-2011, 09:02 PM
I don't understand?!

MattF
05-31-2011, 10:01 PM
$qry="SELECT rsUser,rsBikeman,rsBikemod,rsBikeyear,rsBikecolor,rsDatetaken,rsLocation,rsLocpostcode,rsOtherinfo FROM wmb_members WHERE rsUser = '{$_SESSION['RSUSER']}'";


or:



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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum