Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

bouncing to another page

jananijanani Posts: 16Member
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.

Comments

  • ManningManning Posts: 1,621Member
    : 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)
Sign In or Register to comment.