Jump to content

[SOLVED] Parse error: unexpected T_ENCAPSED_AND_WHITESPACE, expecting...


chris_2001

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.