Sorry guys,
but that is not the problem. I added the semi-colons and I am still getting this error:
Warning: session_start() [function.sessio n-start]: Cannot send session cookie - headers already sent by (output started at /home/content/m/i/d/mideasthonors/html/adminloginproce ss.php:1) in /home/content/m/i/d/mideasthonors/html/adminloginproce ss.php on line 6
Warning: session_start() [function.sessio n-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/m/i/d/mideasthonors/html/adminloginproce ss.php:1) in /home/content/m/i/d/mideasthonors/html/adminloginproce ss.php on line 6
Warning: mysql_num_rows( ): supplied argument is not a valid MySQL result resource in /home/content/m/i/d/mideasthonors/html/adminloginproce ss.php on line 20
Warning: Cannot modify header information - headers already sent by (output started at /home/content/m/i/d/mideasthonors/html/adminloginproce ss.php:1) in /home/content/m/i/d/mideasthonors/html/adminloginproce ss.php on line 24
This is my code:
[code=php]
<?php
ob_start();
include("admin-dbcon.php");
// you need this to be able to use sessions
session_start() ;
//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
$qry = mysql_query("
SELECT * from admin_login
WHERE = username = '$sUsername'
AND password = '$sPassword'
");
// check the number of rows returned
if(mysql_num_ro ws($qry) == 0)
{
// not a valid login redirect to fail
header("Locatio n: login-error.php");
exit;
}
// if you get here then you have made a match
// store data in session variables
$row = mysql_fetch_arr ay($qry);
$_SESSION['username'] = $row['username'];
$_SESSION['userid'] = $row['ID'];
// redirect user onto admintasks.php
header("Locatio n: admintasks.php" );
ob_end_flush();
?>
[/code]
but that is not the problem. I added the semi-colons and I am still getting this error:
Warning: session_start() [function.sessio n-start]: Cannot send session cookie - headers already sent by (output started at /home/content/m/i/d/mideasthonors/html/adminloginproce ss.php:1) in /home/content/m/i/d/mideasthonors/html/adminloginproce ss.php on line 6
Warning: session_start() [function.sessio n-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/m/i/d/mideasthonors/html/adminloginproce ss.php:1) in /home/content/m/i/d/mideasthonors/html/adminloginproce ss.php on line 6
Warning: mysql_num_rows( ): supplied argument is not a valid MySQL result resource in /home/content/m/i/d/mideasthonors/html/adminloginproce ss.php on line 20
Warning: Cannot modify header information - headers already sent by (output started at /home/content/m/i/d/mideasthonors/html/adminloginproce ss.php:1) in /home/content/m/i/d/mideasthonors/html/adminloginproce ss.php on line 24
This is my code:
[code=php]
<?php
ob_start();
include("admin-dbcon.php");
// you need this to be able to use sessions
session_start() ;
//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
$qry = mysql_query("
SELECT * from admin_login
WHERE = username = '$sUsername'
AND password = '$sPassword'
");
// check the number of rows returned
if(mysql_num_ro ws($qry) == 0)
{
// not a valid login redirect to fail
header("Locatio n: login-error.php");
exit;
}
// if you get here then you have made a match
// store data in session variables
$row = mysql_fetch_arr ay($qry);
$_SESSION['username'] = $row['username'];
$_SESSION['userid'] = $row['ID'];
// redirect user onto admintasks.php
header("Locatio n: admintasks.php" );
ob_end_flush();
?>
[/code]
Comment