PDA

Click to See Complete Forum and Search --> : Header() Problem - Help Needed


modpluz
Mar 10th, 2006, 07:49 PM
don't know what i'm doing wrong take a look at this code:

<?
Header("Location: http://google.com");
?>


instead of going to google as stated in the code, it gave me "The Page cannot be displayed" error

What should i do?

sciguyryan
Mar 11th, 2006, 06:44 AM
Could be a number fo things, first check that the heaers have not been sent it can sometimes cause problems like this :)

Cheers,

Ryan Jones

john tindell
Mar 11th, 2006, 06:57 AM
I had a problem with something like this a while ago. Try sticking \n \r at the end. Make sure there is a space between them, don't know why but it would only wokr if there was a space between them


<?
Header("Location: http://google.com\n \r");
?>

sciguyryan
Mar 11th, 2006, 07:08 AM
I had a problem with something like this a while ago. Try sticking \n \r at the end. Make sure there is a space between them, don't know why but it would only wokr if there was a space between them


<?
Header("Location: http://google.com\n \r");
?>


Hmm, I never knew you could do that - that should mean you can send multiple statements at once right?


Cheers,

Ryan Jones

john tindell
Mar 11th, 2006, 07:15 AM
But you can call the header function as many times as you need to. Just as long as nothing has been sent to the browser already.

sciguyryan
Mar 11th, 2006, 07:17 AM
But you can call the header function as many times as you need to. Just as long as nothing has been sent to the browser already.

Yes I know but what I mean is I can now use that to finish the headerBuild function I have been working on - I like everything in one place :)

Cheers,

Ryan Jones

visualAd
Mar 11th, 2006, 03:11 PM
First, try viewing the page in a nother browser. To see the real error message provided by the web server, turn off friendly HTTP errors messages in the advanced section of Internet Properties.