1. Is there any whitespace before the first <? tag? 2. Where is the authenticate function defined -- what does it do, what's its code, etc? Could it be returning HTML prematurely?
Otherwise everything looks ok. -Mike At 11:03 AM 5/1/2002 -0400, Dean Sadler wrote: >I am having troubles with the following script. When executed I get the 500 >internal server error page and an error: Premature end of script headers: >c:/php/php.exe in the log files. If I comment out the header() line it >works fine. I would like to redirect to the proper page based on login >pass/fail. Can any one see what I am doing wrong? > ><? >// Login script >//authenticate using form variables >$status = authenticate($f_user, $f_pass); > >// if user/pass is correct >if ($status == 1) >{ > //initiate a session > session_start(); > > //register some session variables > session_register("SESSION"); > > //including the username > session_register("SESSION_UNAME"); > $SESSION_UNAME = $f_user; > > //redirect to page > header("Location: /worked.php"); //<-- problem area. > exit(); >} >else >// user/pass failed >{ > //redirect to error page > header("Location: /failed.php"); > exit(); >} > >---snip--- > > >-- >PHP Windows Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php Mike Flynn - Burlington, VT http://www.mikeflynn.net/ - [EMAIL PROTECTED] home=>work=>home=>store=>home [repeat daily] -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php