from: http://www.php.net/manual/en/function.header.php
"Remember that the header() function must be called before any actual output
is sent, either by normal HTML tags blank lines in a file, or from PHP. It
is a very common error to read code with include(), or require(), functions,
or another file access function, and have spaces or empty lines that will
output before header() is called. The same problem exists when using a
single PHP/HTML file."

- John Vanderbeck
- Admin, GameDesign

----- Original Message -----
From: "Brandon Feldhahn" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, February 17, 2001 4:05 PM
Subject: [PHP] php


> im trying to make somthing that takes the user to the members page if
> the authentecation is right, but i keep getting this error:
>
> Warning: Cannot add header information - headers already sent by (output
> started at C:\www\login2.PHP:7) in C:\www\login2.PHP on line 30
>
> and this is my code:
>
> <HTML>
> <HEAD>
>
> <TITLE>My Login Form</TITLE>
> </HEAD>
>
> <?
> require ('header.php');
> switch ($do) {
>
>  case "authenticate":
>
>  $connection = mysql_connect("localhost", "brandon", "******")
>     or die ("Couldn't connect to server.");
>
>  $db = mysql_select_db("TNB", $connection)
>   or die ("Couldn't select database.");
>
>  $sql = "SELECT id
>   FROM members
>   WHERE username='$username' and password='$password'";
>
>   $result = mysql_query($sql)
>   or die("Couldn't execute query.");
>
>  $num = mysql_numrows($result);
>
>  if ($num == 1) {
>
>  header("Location:index.php");
>
>  }else if ($num == 0)  {
>
>   unset($do);
>   echo "<font color='ff0000'>You are not authorized! Please try
> again.</font></p>";
>   include("login_form.irc");
>
>  }
>
>  break;
>
>  default:
>
>   include("login_form.irc");
>
> }
> require ('footer.php');
> ?>
>
> </BODY>
> </HTML>
>
> Line 30 is in bold.
> what should i do? PLEASE HELP
>
>
> --
> 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]
>
>


-- 
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]

Reply via email to