Need some help here, Im getting this error: Warning: Cannot add header information - headers already sent by (output started at /home/p/pe/perphp/public_html/login.php:4) in /home/p/pe/perphp/public_html/login.php on line 44
...while trying to run the following .PHP code on my server. Any ideas why this doesnt work? (Im trying to setup user authentication and found this on the Webmonkey site) All tips are appreciated!! <HTML><HEAD><TITLE>dummy</TITLE></HEAD> <BODY> <?php // File Name: auth02.php // Check to see if $PHP_AUTH_USER already contains info if (!isset($PHP_AUTH_USER)) { // If empty, send header causing dialog box to appear header('WWW-Authenticate: Basic realm="My Private Stuff"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } else if (isset($PHP_AUTH_USER)) { if (($PHP_AUTH_USER != "admin") || ($PHP_AUTH_PW != "abc123")) { header('WWW-Authenticate: Basic realm="My Private Stuff"'); header('HTTP/1.0 401 Unauthorized'); echo 'Authorization Required.'; exit; } else { echo " <P>You're authorized!</p> "; } } ?> </BODY> </HTML> -- 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]