Forum Moderators: coopster

Message Too Old, No Replies

unexpected T DOUBLE ARROW

         

PartisanEntity

5:30 pm on May 3, 2009 (gmt 0)

10+ Year Member



I keep getting the following error with this script:

Parse error: syntax error, unexpected T_DOUBLE_ARROW

Line 22 is where the if statement starts:

$content = mysql_query("SELECT * FROM users where nick = '$username'");

//check to make sure we have this user
$success = mysql_fetch_row($content);

while($row = mysql_fetch_array($content))
{
$db_password = $row['password'];
}

if ($success[0] => 1 && $password == $db_password) {
$_SESSION['loggedin'] = 1;
}
else {header('Location: /login.php?error=1');}

PartisanEntity

6:13 pm on May 3, 2009 (gmt 0)

10+ Year Member



I fixed the error by changing => to >= in the if statement.

But now I get this error:

Cannot modify header information - headers already sent by (output started at /Applications/webserver/bigproject/login_check.php:22) in /Applications/webserver/bigproject/login_check.php on line 26

penders

8:26 am on May 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Are you getting any other errors prior to this error?! Basically, as the error states, you cannot send http headers once you have started to output your page (inc. any errors that are output/sent to the browser), in which case the headers have already been sent (to the client).

Any blank lines / spaces before your opening <?php ...?

eeek

9:41 am on May 4, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



$success = mysql_fetch_row($content);

What are you trying to do with that line?