chris_2001 Posted August 22, 2007 Share Posted August 22, 2007 Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in c:\program files\easyphp1-7\www\login.php on line 27 this is the error im getting, and i know its probably really ovious but i really cant fix it :/ <?php include('./anti_inject.php'); include('./settings.php'); $login = $_POST['user']; $pass = $_POST['pw']; $login = test($login); $pass = test($pass); $msconnect=odbc_connect("$dbname","$dbuser","$dbpass"); $msquery="SELECT COUNT(strACcountID) FROM tb_user WHERE strACcountID = '$login' AND strPasswd = '$pass'"; $msresults=odbc_exec($msconnect,$msquery) or die("error"); odbc_fetch_row($msresults); if (odbc_result($msresults,1) > 0) { $msteste="SELECT Admin FROM Website_acc WHERE strUserID = $login; $msresul=odbc_exec($msconnect,$msteste) or die(odbc_error()); odbc_fetch_row($msresul); $Admin = odbc_result($msresul, 1); if ($admin == 0) { $_SESSION['sesuser'] = $login; $_SESSION['sespw'] = $pass; $_SESSION['sesadmin'] = "1"; header("Location: index.php"); } else { $_SESSION['sesuser'] = $login; $_SESSION['sespw'] = $pass; $_SESSION['sesadmin'] = "0"; header("Location: index.php"); } } else { header("Location: index.php?act=logerror"); } /* $_SESSION['user'] = $_POST['user']; $_SESSION['pw'] = $_POST['pw']; $head = 'Location: ./user/index.php header($head);*/ ?> this is the php that is givin me the error on my site (as you can see it is for logging in (giving the user admin or no admin), and its really starting to piss me off so any help appreciated. Link to comment https://forums.phpfreaks.com/topic/66091-solved-parse-error-unexpected-t_encapsed_and_whitespace-expecting/ Share on other sites More sharing options...
Aeglos Posted August 22, 2007 Share Posted August 22, 2007 In case you haven't solved it yet; You are missing a closing double quote in this line: $msteste="SELECT Admin FROM Website_acc WHERE strUserID = $login; Should read: $msteste="SELECT Admin FROM Website_acc WHERE strUserID = '$login'"; or $msteste="SELECT Admin FROM Website_acc WHERE strUserID = '".$login."'"; Link to comment https://forums.phpfreaks.com/topic/66091-solved-parse-error-unexpected-t_encapsed_and_whitespace-expecting/#findComment-330580 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.