Skip to content Skip to sidebar Skip to footer

Form With Paypal Button + Email The Entries

I'm new to this site - So I apologise if I've done anything wrong. Basically, I currently have a PHP (and javascript) Paypal form, which provides 9 drop-down questions to my custom

Solution 1:

What you could do is have your form submit to a PHP script, and then that PHP script saves your order information to a database, sends to you via email etc. Once the script’s done that, you can simply redirect to PayPal with the order amount. An example:

<?phpif (isset($_POST['submit'])) {
    // get user's options and calculate price// either save to database, send order details via email, or (preferably) both// send the user to PayPal to pay for purchase$query_data = array(
        'business' => 'your-paypal-email-address',
        'cmd' => '_xclick',
        'item_name' => 'Order #' . $order_id, // $order_id could be last_insert_id() from saving database'amount' => '100.00', // the cost of the item'shipping' => '10.00'// the cost of shipping the item
    );
    header('Location: https://www.paypal.com/cgi-bin/websrc/?' . http_build_query($query_data));
    exit;
}

You’ll need to flesh out the bits where you calculate the price, and saving to the database and/or sending the order details via email, but should be enough to get you going. It’s mainly to demonstrate how to redirect to PayPal in your PHP script.

Post a Comment for "Form With Paypal Button + Email The Entries"