eburlea 23 Junior Poster

I get an error and I cannot figure out what is the problem.

Error:

Warning: Cannot modify header information - headers already sent by (output started at z:\home\localhost\www\soccerstatistics\admin\new_team.php:1) in z:\home\localhost\www\soccerstatistics\admin\lock.php on line 6

  1. <?php
  2. include("blocks/db.php");
  3. if (!isset($_SERVER['PHP_AUTH_USER']))
  4. {
  5. Header ("WWW-Authenticate: Basic realm=\"Admin Page\"");
  6. Header ("HTTP/1.0 401 Unauthorized");
  7. exit();
  8. }

  9. 11.else {
  10. if (!get_magic_quotes_gpc()) {
  11. $_SERVER['PHP_AUTH_USER'] = mysql_escape_string($_SERVER ['PHP_AUTH_USER']);
  12. $_SERVER['PHP_AUTH_PW'] = mysql_escape_string($_SERVER['PHP_AUTH_PW']);
  13. }
  14. $query = "SELECT pass FROM userlist WHERE user='".$_SERVER['PHP_AUTH_USER']."'";
  15. $lst = @mysql_query($query);
  16. if (!$lst)
  17. {
  18. Header ("WWW-Authenticate: Basic realm=\"Admin Page\"");
  19. Header ("HTTP/1.0 401 Unauthorized");
  20. exit();
  21. }
  22. if (mysql_num_rows($lst) == 0)
  23. {
  24. Header ("WWW-Authenticate: Basic realm=\"Admin Page\"");
  25. Header ("HTTP/1.0 401 Unauthorized");
  26. exit();
  27. }
  28. $pass = @mysql_fetch_array($lst);
  29. if ($_SERVER['PHP_AUTH_PW']!= $pass['pass'])
  30. {
  31. Header ("WWW-Authenticate: Basic realm=\"Admin Page\"");
  32. Header ("HTTP/1.0 401 Unauthorized");
  33. exit();
  34. }
    41.}
    42.?>

Please advise...