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]

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.