Page 1 of 1

Need Help with error message

Posted: Thu May 04, 2006 6:55 pm
by mfbrowne
Well it seems I am stuck again. Once I get a valid piece of information from the form I built I then try and go to my next page using the following code

Code: Select all

<?
            header('Location:http://localhost/test2.php); 
?>



and I get the following message.

Warning: Cannot modify header information - headers already sent by (output started at C:\sokkit\site\TestReserve11.php:186) in C:\sokkit\site\TestReserve11.php on line 266

So first of all why would I get this message and what do I do to correct it. Am I using the wrong function to transfer to my next page.

Thanks for any information.

Posted: Thu May 04, 2006 8:37 pm
by LiveFree
Well,

If that code above is not the whole script, then make sure NO HTML or blank space is sent to the browser before the header call.

And...
You need to change that to:

Code: Select all

<?
            header('Location:http://localhost/test2.php');
?>
[/syntax]

Posted: Thu May 04, 2006 8:45 pm
by mfbrowne
Well I have processed a form with a couple of entries on it, is that considered sending to the browser. If so how do I transfer to another web page after collecting data. Seems this part is escaping my understanding for some reason.

Also, you say I should change the code to what you have indicated, but I see not difference. Can you point it out to me.

Thanks

Posted: Thu May 04, 2006 9:20 pm
by Burrito
try searching this forum for your answer...we've discussed this problem several times.

Posted: Thu May 04, 2006 11:22 pm
by feyd
"several" hahaha

Enough times that I've had this URL memorized for at least a year.

viewtopic.php?t=1157