i keep getting this error.
Parse error: syntax error, unexpected T_BOOLEAN_AND, expecting ',' or ')' in /home/cfdistro/public_html/include.php on line 12
heres the code
function auth($user,$pass){
if(isset($_COOKIE['loginok'] && $_COOKIE['username'] && $_COOKIE['password'])){
$query = 'select * from `users` where `user` = '.$_COOKIE['username'].' and `enc` = '.$_COOKIE['password'].', limit 1;';
$result = mysql_query($query);
$auth = mysql_num_rows($result);
if($auth == 1){
setcookie("loginok", "1", time() + (60 * 60 * 6));
setcookie("username", $user, time() + (60 * 60 * 6));
setcookie("password", $passenc, time() + (60 * 60 * 6));
$logdin = '1';}else{
echo 'Your username and or password is incorrect, Please try again or contact support';
$logdin = '0';}}else{
$passenc = bin2hex(mhash(MHASH_SHA256,$pass));
$query = 'select * from `users` where `user` = '.$user.' and `enc` = '.$passenc.', limit 1;';
$result = mysql_query($query);
$auth = mysql_num_rows($result);
if($auth == 1){
setcookie("loginok", "1", time() + (60 * 60 * 6));
setcookie("username", "$user", time() + (60 * 60 * 6));
setcookie("password", $passenc, time() + (60 * 60 * 6));
$logdin = '1';}else{
echo 'Your username and or password are incorrect, Please try again or contact support';
$logdin = '0';
}}
return $logdin;
}
any help would be much appreciated. thanks