Forum Moderators: coopster

Message Too Old, No Replies

Creating a seperate "Thank You" page

         

crobb305

7:29 pm on Nov 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



After a sale, my "Thank You" occurs on the same page (url) that generated the sale using?php if($showThanks). I want to take the user to a seperate page altogether. How do I do that?

Thanks

eelixduppy

7:50 pm on Nov 24, 2006 (gmt 0)



After you accept the payment redirect the page using header:

[url=http://us2.php.net/manual/en/function.header.php]header[/url]("Location: thank_you.html");

Hope this helps!

Good luck! :)

crobb305

10:25 pm on Nov 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Where do I place that in my code? This is a portion of the code, that seperates the php sections:

<input type="hidden" id="_UI" name="_UI" value="<?php echo $_POST["_UI"];?>">

<!-- END MAIN -->

<?php
} // end $showForm block
?>
<?php if($showThanks)
{
?>

crobb305

10:27 pm on Nov 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



...I just realized that you linked off to the php manual (header). I will take a look, though it looks like it is way beyond my current php skill. Any other suggestions? Thanks for the tip!

Chris

eelixduppy

4:49 am on Nov 25, 2006 (gmt 0)



It would be something like:

if($showThanks) {
header("Location: thank_you.html");
exit();
}

However you must make sure that no text is sent to the browser before you call the header function otherwise it will not work. Refer to the link for more details.

pixeltierra

7:22 am on Nov 25, 2006 (gmt 0)

10+ Year Member



A clarification to what eelixduppy says. Make sure your send NOTHING (not even spaces or empty lines) to the browser before using header redirect.