Header Redirect

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
John
Guest





PostPosted: Wed Aug 21, 2002 3:29 pm    Post subject: Header Redirect Reply with quote

Hi. How can i redirect a page with

header("Refresh:1; url=page.php");

It seems that with the redirect_status thing in the php executable i can't do redirections. Is there a workaround?

Thanks

John
Back to top
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Thu Aug 22, 2002 3:42 am    Post subject: Re: Header Redirect Reply with quote

John wrote:
Hi. How can i redirect a page with

header("Refresh:1; url=page.php");

It seems that with the redirect_status thing in the php executable i can't do redirections. Is there a workaround?

Thanks

John

You are using the wrong header and redirection has nothing to do with REDIRECT_STATUS.
You should use
Code:

header("Location: page.php")

More information can be found in your PHP documentation (in the header statement description).
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
John
Guest





PostPosted: Thu Aug 22, 2002 10:27 am    Post subject: Reply with quote

It still doesn't work.

John
Back to top
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Aug 23, 2002 1:10 am    Post subject: Reply with quote

John wrote:
It still doesn't work.

John

Please tell us exactly what problem you experience. That way we can help you.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Guest






PostPosted: Fri Aug 23, 2002 1:50 am    Post subject: Reply with quote

I have a function in an included file that shows some content and then it uses the header("Refresh:1; url=page.php");
to redirect to another page

Now i'm stuck in that page. It shows the content but doesn't redirect.

header("Location: page.php") doesn't work either nor any other headers i try to send.
In the cgi log file it says that the headers are already sent.

The file works ok with Apache and i've been using it several time now.

Thanks

John
Back to top
John
Guest





PostPosted: Fri Aug 23, 2002 1:52 am    Post subject: Reply with quote

I forgot to mention that i'm using Abyss 1.07 if that matters

John
Back to top
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Aug 23, 2002 2:05 am    Post subject: Reply with quote

John wrote:
I forgot to mention that i'm using Abyss 1.07 if that matters

John

That doesn't matter.
A first thing is to use the following statement :
Code:

header("Refresh: 1;url=mypage.php");

Notice the sapce after :

Also, the refresh header is passed by the web server to your browser. So you should check if your browser supports it. To do so, go to http://www.hixie.ch/tests/evil/mixed/refresh1.http.html .
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
John
Guest





PostPosted: Fri Aug 23, 2002 2:23 am    Post subject: Fixed Reply with quote

I just fixed it. It was the exit(); from the function that was in the wrong place. With Apache it seems that it didn't matter.
Anyway another bug goes.

By the way are there any strong differences between running PHP as a CGI and as a module? I haven't used it in the past as a CGI and i haven't studied it much. I guess it's just a matter of stability and security.

Thanks a lot

John
Back to top
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat Aug 24, 2002 4:29 am    Post subject: Re: Fixed Reply with quote

John wrote:
I just fixed it. It was the exit(); from the function that was in the wrong place. With Apache it seems that it didn't matter.
Anyway another bug goes.

By the way are there any strong differences between running PHP as a CGI and as a module? I haven't used it in the past as a CGI and i haven't studied it much. I guess it's just a matter of stability and security.

Thanks a lot

John

Running PHP as a module is faster than running it as a CGI program. But if the module crashes (for some reason), the entire web server can be affected and can even crash. If a CGI program crashes, it doesn't harm the entire web server so this seems to be the best alternative for stability.
For security, Apache's way to run CGI programs can lead to serious security problems. In Abyss Web Server, CGI programs are run in a secure environment and they aren't subject to the vulenrabilities Apache have.

Thank you.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group