note 51806 added to function.header
| From: | baktec at gmail dot com | Date: | Mon, 11 Apr 2005 20:27:46 +0000 |
| Subject: | note 51806 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-87859@lists.php.net to get a copy of this message | ||
I'm planning to do a simple authentication. I want to redirect the page to another php page
file if the user name and password is correct.
But. I'm having a problem with the header().
HERE is the part of my code that is showing the error.
<body>
<?php
if ($p = $u)
{
header("Location:1.php"); //I'm getting the error below
/*Warning: Cannot modify header information - headers already sent by (output started at
C:\WebRoot\mySite\auth.php:3) in C:\WebRoot\mySite\auth.php on line 4*/
exit;
}
?>
</body>
How can i solve this problem?
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+51806
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+51806&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+51806&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+51806&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+51806&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+51806&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+51806&report=yes
Search -- http://master.php.net/manage/user-notes.php