Warning: Cannot modify header information - headers already sent by (output started at /home/mysite/public_html/redirect_index.php:20) in /home/mysite/public_html/redirect_index.php on line 38
I've converting as asp site to php. I'm a partial numpty in asp and complete numpty in php
I keep being told this is a white space problem..... I can't see it!
The code below is a redirect: from one page to another where a Yes or No is clicked and then redirected accordingly.
The asp code was "converted" to php using a conversion prog, so anything could have happened! Maybe the sequence of events is incorrect?
Any advice greatly appreciated.
<? if(${"SubArea"}=="N")
{
?>
<? setcookie("Copyright2009","do not agree",0,"","",0);
?>
<? header("Location: "."copyrightNotAgree.php");?>
<? }?>
<? $strTemp=$_COOKIE["Copyright2009"];?>
<? echo $strTemp;?>
<? if($strTemp=="agree")
{
?>
<? header("Location: "."index2.php");?>
<? }
else
{
?>
<? if(${"SubArea"}=="Y")
{
?>
<? setcookie("Copyright2009","agree",0,"","",0);
?><?php
//Calculate 30 days in the future
//seconds * minutes * hours * days + current time
$inOneMonth = 60 * 60 * 24 * 30 + time();
setcookie('lastVisit', date("G:i - m/d/y"), $inOneMonth);
?>
<? $URL="http://www.mysite.com/index2.php";?>
<? }
else
{
?>
<? header("Location: copyright.php");?> (this is line 38 referred to in the error message)
<? } ?>
<? } ?>