Jump to content

[SOLVED] Cannot modify header information - error


critical-state

Recommended Posts

Hi, I am having issues with some code I have written. I have commented the problem section below.

the warning message I am receiving is:Warning: Cannot modify header information - headers already sent by (output started at C:\www\Projects\test2.php:21) in C:\www\Projects\test2.php on line 33.

Any ideas or a way round would be great!

Andy

 

 

<select name="day">

<?php

error_reporting(E_ALL);

$day=0;

$year=0;

$_POST['day']=0;

$_POST['year']=0;

 

for($day=01;$day<=31; $day++)

{

echo"<option value='".$day."'";

if($day==$_POST['day'])echo "selected";

echo ">" .$day. "</option>\n";

}

?>

</select>

<select name="year">

<?php

for($year=date("Y");$year>=1900; $year--)//If I set the year to above 1922 I do not get the error message ???

{

echo"<option value='".$year."'";

if($day==$_POST['year'])echo "selected";

echo ">" .$year. "</option>\n";

}

?>

 

 

 

<input type="submit" value="go">

 

<?php

$url= "http://localhost/projects/confirm_signup.php";

header ("location: $url");

exit();

?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.