Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4068574
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T16:23:31+00:00 2026-05-20T16:23:31+00:00

My form action sends hidden inputs to PayPal for checkout. I also need it

  • 0

My form action sends hidden inputs to PayPal for checkout. I also need it to send me an email before it goes to paypal.

But since the action of my form calls paypal I cant trigger the other function. I was thinking I could just have the action=self and do what I need on my page and then send the nessesery post variables to paypal. I am taking a shot at it below:

<?
if(isset($_POST['submit'])){
//get post data for me clean up and save then send

if(!mail(data, myemail, headers)){
//send data to paypal. 
curl(https://www.paypal.com/cgi-bin/webscr);
}

}else{
?>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<!-- DATA FOR ME-->

<p>Child's Name: <? echo $child_name; ?></p>
    <input type="hidden" name="child_name" value="<? echo $child_name; ?>">

<p>Birth Date: <? echo $birth_date; ?></p>
    <input type="hidden" name="birth_date" value="<? echo $birth_date; ?>">

<p>Parent/Guardian Name: <? echo $name; ?></p>
    <input type="hidden" name="name" value="<? echo $name; ?>">

<p>Email Address: <? echo $email; ?></p>
    <input type="hidden" name="email" value="<? echo $email; ?>">

<p>Home Phone: <? echo $phone; ?></p>
    <input type="hidden" name="phone" value="<? echo $phone; ?>">



<!-- DATA FOR PAYPAL-->
<input type="hidden" name="business" value="you@youremail.com">
<input type="hidden" name="item_name" value="Item Name">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="amount" value="<?php echo $total; ?>">
<input type="hidden" name="cmd" value="_s-xclick">
<input type="hidden" name="hosted_button_id" value="XXXXXXXXXX">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
</form>

Should I use curl to resend the data to PayPal once the mail() function on my page was successful? Not sure how that will work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T16:23:32+00:00Added an answer on May 20, 2026 at 4:23 pm

    May be like this

    <?
    $url = "";
    
    if(isset($_POST['submit'])){
    //get post data for me clean up and save then send
    
        if(!mail(data, myemail, headers)){
            $url = "https://www.paypal.com/cgi-bin/webscr";
        }
    
    }else{
    ?>
    <form action="<? echo $url; ?>" method="post">
    
    <!-- Same form as in the original post -->
    
    </form>
    
    <?
    if ($url != "") {
    ?>
    <script language="javascript">
    document.forms[0].submit();
    </script>
    <?
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the following to generate a form: <form method=post action=> <input type=hidden
i never use any payment gateway still now....but now i need to integrate paypal
Possible Duplicate: Variables upon submitting Paypal form //Buy.php <form action=https://www.paypal.com/cgi-bin/webscr method=post> <input type=hidden name=cmd
I have some disabled inputs in a form and I want to send them
<form class=follow-form method=post action=listen.php> <input name=followID value=123456 type=hidden> <button type=submit value=Actions class=btn follow title=123456>
it it possible to get the form action of a GET form on submit
I am having problem with overriding Form Action URL I have a class to
I have a jsp with a submit based on the html:form action. <html:form action=/nextPath>
<form action = settings.php method = post> Student ID*: <input type = text name
Given some typical search form, I can't construct this form action when submitting a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.