I removed the print_r codes and the header comments, and now am back to getting the unexpected $end error again. I am absolutely flustered with this scripting.
This is what I have:
[code=php]
<?php
include("admin-dbcon.php");
//sanitize the user input to ensure random usernames cannot be used
$sUsername= mysql_real_esca pe_string($_POS T ['Username']);
$sPassword = mysql_real_esca pe_string($_POS T['Password']);
//ensure username and password are valide
$sql ="SELECT * from admin_login WHERE $sUsername = 'username' AND $sPassword = 'password'";
if ($validate = mysql_query($sq l))
{
$isvalide=mysql _num_rows($vali date);
echo $isvalide;
//if valid login send on, if not send to error page
if ($isvalide)
{
$_SESSION['username'] = $_POST['username'];
while ($row=mysql_fet ch_array($valid ate))
{
$_SESSION['userid']=$row["ID"];
}
{
$_SESSION['username'] = $_POST['username'];
while ($row=mysql_fet ch_array($valid ate))
{
$_SESSION['userid']=$row["ID"];
}
header("Locatio n: admintasks.php" );
}
header ("Location: login-error.php");
?>
[/code]
And this is the error I am getting:
Parse error: syntax error, unexpected $end in /home/content/m/i/d/mideasthonors/html/adminloginproce ss.php on line 32
When I deleted the echo statement as you suggested and the last curly bracket that went with it, it began to say this. So I replaced the curly bracket and I am still getting this error:(
This is what I have:
[code=php]
<?php
include("admin-dbcon.php");
//sanitize the user input to ensure random usernames cannot be used
$sUsername= mysql_real_esca pe_string($_POS T ['Username']);
$sPassword = mysql_real_esca pe_string($_POS T['Password']);
//ensure username and password are valide
$sql ="SELECT * from admin_login WHERE $sUsername = 'username' AND $sPassword = 'password'";
if ($validate = mysql_query($sq l))
{
$isvalide=mysql _num_rows($vali date);
echo $isvalide;
//if valid login send on, if not send to error page
if ($isvalide)
{
$_SESSION['username'] = $_POST['username'];
while ($row=mysql_fet ch_array($valid ate))
{
$_SESSION['userid']=$row["ID"];
}
{
$_SESSION['username'] = $_POST['username'];
while ($row=mysql_fet ch_array($valid ate))
{
$_SESSION['userid']=$row["ID"];
}
header("Locatio n: admintasks.php" );
}
header ("Location: login-error.php");
?>
[/code]
And this is the error I am getting:
Parse error: syntax error, unexpected $end in /home/content/m/i/d/mideasthonors/html/adminloginproce ss.php on line 32
When I deleted the echo statement as you suggested and the last curly bracket that went with it, it began to say this. So I replaced the curly bracket and I am still getting this error:(
Comment