It looks as if this code is being called from another php file....
If so the ob_start(); should be at the top of the file calling this along with the session_start(); and removed from the code sent.
Session error looks like its saying that session has already been started and the header error is saying that output has already been sent to the browser.
Guessing yout main script has outputed something then called this??
Quote:
if ($isvalid != 0) {
$_SESSION['username'] = $_POST[username];
while ($row=mysql_fetch_array($validate)){
$_SESSION['userid']=$row["ID"];
}
header("Location: admintasks.php");
}
This should be something like this
- if ($isvalid == 1) {
-
$_SESSION['username'] = $_POST[username];
-
$_SESSION['userid']=mysql_result($isvalid, "ID");
-
-
header("Location: admintasks.php");
-
}
-
else if($isvalid > 1)
-
{/*ERROR code here*/}
As what if there were multiple lines with the same username?
If you are going to use the fetch array loop method you need mysql_fetch_assoc not mysql_fetch_array.