简体   繁体   中英

How to redirect based on url paramater

I have a form on my website Where users can specify if they'd like a monthly or annual subscription (it's a radio option). This form gets sumbitted to my CRM system, which redirects the user to www.site.com/is_to_pp.php?payment=Monthly&Address1=blah (and other url variables).

Depending on whether ?payment=Monthly or ?payment=Annual I want to redirect them to a different paypal subscription page. I also want to pass the other variables to paypal to prepopulate the address fields.

Ie the user fills out one form on our site, specifying how they'd like to pay, they are added to our crm system, and then redirected to the appropriate PayPal Page.

Does anyone have an idea of how to structure the is_to_pp.php file to handle this?

Any help/guidance is appreciated

Thanks

Charlie

Do you mean something like this:

<?php
if ($_GET["payment"] == "Monthly") {
    header( 'Location: http://www.pageyouwant.com' );
    header("Location: paypalpage.com?payment=".$_GET['payment']."&address=".$_GET['address']);
} else {
    header("Location: paypalpage.com?payment=".$_GET['payment']."&address=".$_GET['address']);
}
?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM