Need Help with error message

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mfbrowne
Forum Newbie
Posts: 16
Joined: Tue May 02, 2006 11:45 am

Need Help with error message

Post 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.
LiveFree
Forum Contributor
Posts: 258
Joined: Tue Dec 06, 2005 5:34 pm
Location: W-Town

Post 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]
mfbrowne
Forum Newbie
Posts: 16
Joined: Tue May 02, 2006 11:45 am

Post 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
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

try searching this forum for your answer...we've discussed this problem several times.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

"several" hahaha

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

viewtopic.php?t=1157
Post Reply