Web Hosting Talk







View Full Version : PHP redirect


blue27
07-06-2003, 03:11 PM
I have asked this before but I'll ask it in a different format.
I have an order for to be filled out. The form will be different depending on what plan is chosen.
http://www.hampshirehosting.ca/hostingplans.php
The form page is register.php and depending on the plan chosen the resulting page will look something like this
http://www.hampshirehosting.ca/register.php?t=h&p=Starter
What I need to know is assuming I will be adding a place on the form for the client to select a payment method, (Paypal or Credit Card) how can I make it so they are redirected to the appropriate payment page for the selected plan and selected payment method?

TAH-Max
07-06-2003, 06:59 PM
I'm not quite sure I understand what you're saying but...

The user can choose CC or PayPal from a drop down list, correct? Then they click continue and it sends them to the correct payment processor, right?
At the top of your page put

ob_start();


if($payType == "cc")
{
header("Location: http://www.2checkout.com/whatever");
} elseif($payType == "pp")
{
header("Location: http://www.paypal.com/whatever");
} else {
print "Please go back and select a payment method.";

Hope that's what you were looking for
Max

Pro-Technic
07-06-2003, 07:09 PM
[QUOTE]Originally posted by TAH-Max

ob_start();


if($payType == "cc")
{
header("Location: http://www.2checkout.com/whatever");
} elseif($payType == "pp")
{
header("Location: http://www.paypal.com/whatever");
} else {
print "Please go back and select a payment method.";


The above code probably doesn't work, leave out the BBcode in your post and it's fine :)

Corrected code:


if($payType == "cc")
{
header("Location: http://www.2checkout.com/whatever");
} elseif($payType == "pp")
{
header("Location: http://www.paypal.com/whatever");
} else {
print "Please go back and select a payment method.";


EDIT: oh well, seems like wht puts the BBcode in it automatically :( Just leave all the html out and it should work.

blue27
07-06-2003, 08:24 PM
Thank you guys. I'll give it a try.
TAH-Max, you are right about the drop down menu.

Daijoubu
07-06-2003, 11:04 PM
lol vB parser is buggy

dreamrae.com
07-07-2003, 01:14 AM
Originally posted by Daijoubu
lol vB parser is buggy

heh:stickout:

digitok
07-07-2003, 01:20 AM
You can turn off auto-url parsing.