PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1848
Number of posts: 5016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
bouncing to another page Posted by janani on 24 May 2004 at 9:41 AM
Hi,
was wondering whether there was any way to automatically forward a user to another cgi page without them having to do anything.

More specifically, I want to be doing lots of behind the scenes validation stuff, but don't actually want to display any of that, so once it's done 9and everything is satisfied) I want to quickly push the user onto the next page (else they'll be sent back to re-enter data).

Is this possible? If so how? Thanks guys, muchly appreciated.

Report
Re: bouncing to another page Posted by Manning on 24 May 2004 at 7:12 PM
: Hi,
: was wondering whether there was any way to automatically forward a user to another cgi page without them having to do anything.
:
: More specifically, I want to be doing lots of behind the scenes validation stuff, but don't actually want to display any of that, so once it's done 9and everything is satisfied) I want to quickly push the user onto the next page (else they'll be sent back to re-enter data).
:
: Is this possible? If so how? Thanks guys, muchly appreciated.

Yeah, you can use a redirect. This is the most common way:

header("Location: http://www.yoursite.com/newpage.php");

The URL you provide is the URL they will be redirected to. Since this modifies the headers, you either have to call this before ANY output is sent to the user (even just whitespace), or you have to enable buffering (Check out http://www.php.net/manual/en/function.ob-start.php to see how to do page specific buffering)



 

Recent Jobs