Hello everyone, I have a big problem with the header function. I use it like this:
//------------------------------------------------------------------
header("Location: http://127.0.0.1/page1/php/Admin.php");
exit;
//------------------------------------------------------------------
and it returns with this error message:
Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\wwwroot\page1\php\authenticate.php:1) in C:\Inetpub\wwwroot\page1\php\authenticate.php on line 15
I read somewhere in the forums that you cannot have any output to the browser prior to that but I don't.. Here is all my html code above.
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title> Welcome to my website </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body background="..\Images\Backgrounds\backgroundImage.jpg">
<?php
if ($_SERVER['REQUEST_METHOD'] != 'POST')
{
header("Location: http://127.0.0.1/page1/php/Admin.php");
exit;
}
PLEASE SOMEONE HELP!!! THANK YOU = )