The original scripts of login.php have the line: require("lib.inc");, the lib.inc is as below
<? function connectdb(){ $handler=mysql_connect("localhost","",""); if($handler==false){ echo "Failed connecting to database."; exit(); } $handler=mysql_select_db("database"); if($handler==false){ echo "Failed connecting to database."; exit(); } return $handler; } ?> After I deleted the require() line, and use myslq_connect() and mysql_select_db() in the login.php, the header() does work. So I think there must be some output while running at the line of "return $handler;" Regards Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]