|
-
Mar 10th, 2006, 08:49 PM
#1
Thread Starter
Fanatic Member
Header() Problem - Help Needed
don't know what i'm doing wrong take a look at this code:
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?
-
Mar 11th, 2006, 07:44 AM
#2
Re: Header() Problem - Help Needed
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
-
Mar 11th, 2006, 07:57 AM
#3
<?="Moderator"?>
Re: Header() Problem - Help Needed
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
PHP Code:
<?
Header("Location: http://google.com\n \r");
?>
-
Mar 11th, 2006, 08:08 AM
#4
Re: Header() Problem - Help Needed
 Originally Posted by john tindell
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
PHP Code:
<?
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
-
Mar 11th, 2006, 08:15 AM
#5
<?="Moderator"?>
Re: Header() Problem - Help Needed
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.
-
Mar 11th, 2006, 08:17 AM
#6
Re: Header() Problem - Help Needed
 Originally Posted by john tindell
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
-
Mar 11th, 2006, 04:11 PM
#7
Re: Header() Problem - Help Needed
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|