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

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.