Jump to content

[SOLVED] I have no idea where this T_ENCAPSED_AND_WHITE_SPACE error is coming from.


golin_knar

Recommended Posts

I'm creating a log in form in a templating framework and just as I finished typing up the logic for user validation I got a:

 

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in login.php on line 28

 

The section I was doing the logic in when things messed up is here:

//start object buffer
ob_start(); 
//check validation, if bad send error else redirect to index
if(isset($_POST['submit']))
{
if(isset($_POST['username']))
{
	if(isset($_POST['password']))
	{
		$user = $_POST['username'];
		$passwd = sha1($_POST['password']);
		$result = query('select count(*),role from Users where password ="'.$passwd.'" and username="'.$user.'"');	  //a function in dbconnect.php that wraps up sending a query through oracle osi functions.. it works.
		if($result[0] == 1) //nrows == 1
		{
			$_SESSION['username'] = $user;
			//redirect to index. its in my RedirectBrowserException.php.  Its working.
			throw new RedirectBrowserException('index.php');	
		}
		else
			echo "Error: Username / Password didn't match any of our records.  Are you sure you're registered?\n<br/>\n";
	}
	else
		echo "Error: You forgot to type in a password :-) <br/> \n";
}
else
	echo "Error: You forgot to type in a username : - ) <br/> \n";
}
$output=ob_get_clean();

 

My full code is attached in a regular text file.  Do any of you have an idea of where the error could be coming from?

 

 

[attachment deleted by admin]

Thank you so much!  I have no idea why I typed that character there, but I definitely wasn't going to find that one on my own.  Now I know to do a search for ` every time I can't find where my errors come from.  Thanks again!

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.