I am developing a PHP app using Win2kSrv-IIS5+MSSQL2k+PHP4.3
The login.php page submits via POST method to loginrespond.php which queries the DB for authentication. Because the spec for this app calls for not using cookies I then have to write some info to an activeusers table. Then the loginrespond.php page redirects the user to the adminmenu.php page (see code below).
Everything works as advertised except the redirect page has the following error:
"The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:"
and the rest is blank.
The DB has an entry in the table. No errors from the query are visible that I can see. The strange thing is that if I comment out the insert into the DB the redirect works flawlessly, except the fact that the DB is not updated.
The content of the adminmenu.php page does not matter. I have tried the real content and a simple hello world page. The error is in the exiting of the loginrespond.php page I think, but I cannot isolate it. HELP!
------ Code from loginrespond.php -------
....initial query to check username and
password all works great then.....
// get users information from the query
$uid = mssql_result($result,$i,"ID");
$seclvl = mssql_result($result,$i,"SecurityLevel");
$time = date("U");
// query string to insert the user into the DB
$newquery = "INSERT INTO ActiveUsers (UID, TimeStamp, SecurityLevel) VALUES ($uid, $time, $seclvl)";
if (!mssql_query($newquery)) {
print "Failed to start a new user session<br>\n";
exit;
}
Header("Location: http://zurn/capb/admin/adminmenu.php?sid=$uid%20$time");
?>