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]

Reply via email to