Jump to content

PHP Newbie - Redirect when button click


clbrownAlpine

Recommended Posts

Hi there,

 

I wonder if someone can help me. I'm a newbie to PHP and I'm developing a registration form for a conference we will be hosting next year.

 

What I would like to do is the following:

I've got the main registration page at http://www.alpinemalta.net/onlineForms/APV/PBPform4.html

 

What happens is that the info gets sent to the next page which displays it in a summary form.

 

At the bottom is the total and a button will become available to pay with paypal.

 

This is where my challenge is now....when the "PayNow" button is clicked and the next step is that all the information is sent via email back to us and then the user is redirected to the PayPal site.

 

The Summary page is in a php format.  Is there a command in PHP that says only when the button is clicked to continue the next part of the code which is send the email and on to the payment page?

 

I hope someone can help me  8)

 

Best Regards - Christopher

Link to comment
https://forums.phpfreaks.com/topic/154339-php-newbie-redirect-when-button-click/
Share on other sites

Not really...But what you could do is something like this:

 

$email = $_GET['email'];
if(!isset($email))
{
echo '<form action="'.$_SERVER['PHP_SELF'].'?email=true" method="post">
...whatever...all of your form stuff.
<input type="submit">
</form>';
}
else
{
mail('you'...and so forth
header('Location: paypal.com');
}

 

Something along those linse.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.