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]