Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/content/m/i/d/mideasthonors/html/adminloginprocess.php:1) in /home/content/m/i/d/mideasthonors/html/adminloginprocess.php on line 5
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/content/m/i/d/mideasthonors/html/adminloginprocess.php:1) in /home/content/m/i/d/mideasthonors/html/adminloginprocess.php on line 5
Warning: Cannot modify header information - headers already sent by (output started at /home/content/m/i/d/mideasthonors/html/adminloginprocess.php:1) in /home/content/m/i/d/mideasthonors/html/adminloginprocess.php on line 7
Warning: Cannot modify header information - headers already sent by (output started at /home/content/m/i/d/mideasthonors/html/adminloginprocess.php:1) in /home/content/m/i/d/mideasthonors/html/adminloginprocess.php on line 24
This is the code I am using:
<?php
ob_start();
// first, let's destroy the previous session just in case it wasn't beforehand
// the new session will start at the news-edit page
session_start();
header("Cache-control: private"); //IE 6 Fix
set_time_limit(600);
include("admin-dbcon.php");
//Check to see if the username and password is valid (if it is in the database)
$validate = mysql_query("select * from admin_login where username = '$_POST[username]' and password = '$_POST[password]'");
$isvalid=mysql_num_rows($validate);
//if valid login send on, if not send to error page
if ($isvalid != 0) {
$_SESSION['username'] = $_POST[username];
while ($row=mysql_fetch_array($validate)){
$_SESSION['userid']=$row["ID"];
}
header("Location: admintasks.php");
}
//else {
// header("Location: login-error.php");
//}
?>