Jason wrote:
I have a screen where I ask the user their payment type. Once they
select the payment type either check or credit card, I would like them
to go to a seperate checkout page. How can I write a bit of code to
make .php re-direct them to the proper page? (I considered doing this
with Javascript, but would rather keep it all in .php)
Thanks,
ja***@davispowers.com
Two things you can do.
1) (my preferred method): Just have it on the same page, and output
different things on that page based on the payment type.
for example:
if ($_GET['paymentType'] == "creditcard")
{
// output the form for credit card crap
}
else
{
// output for check etc
}
2) If they are radically different and it really is appropriate to send them
to different actual pages, you can do (at the top of the page, before
*anything* is outputted, including blank spaces/lines etc)
<?php
// process whatever you need to, but output NOTHING
if ($_GET['procType'] == "creditcard")
header("Location: http://www.mysite.com/creditcard.php");
else
header("Location: http://www.mysite.com/otherpayment.php");
?>