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 6535557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:23:13+00:00 2026-05-25T10:23:13+00:00

If I use the standard PayPal form for payments can I also update my

  • 0

If I use the standard PayPal form for payments can I also update my db at the same time, by changing the code slightly to include the update details?

This is the standard PayPal payment form I want to use – Will change as necessary..

 <form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="payPalForm">

 <input type="hidden" name="item_number" value="01 - General Payment to FreelanceSwitch.com">
 <input type="hidden" name="cmd" value="_xclick">
 <input type="hidden" name="no_note" value="1">
 <input type="hidden" name="business" value="your@paypalaccount.com">
 <input type="hidden" name="currency_code" value="USD">
 <input type="hidden" name="return" value="http://freelanceswitch.com/payment-complete/">

 Item Details:<br /><input name="item_name" type="text" id="item_name"  size="45">
 <br /><br />
 Amount: <br /><input name="amount" type="text" id="amount" size="45">
 <br /><br />
 <input type="submit" name="Submit" value="Submit">

 </form>

This is my update coding in my page:

 $editFormAction = $_SERVER['PHP_SELF'];
 if (isset($_SERVER['QUERY_STRING'])) {
   $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
 }

 if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form")) {
   $updateSQL = sprintf("UPDATE db SET payment_page_completed=%s WHERE id=%s",
                   GetSQLValueString($_POST['payment_page_completed'], "text"),
                   GetSQLValueString($_POST['id'], "int"));

   mysql_select_db($database_connAdmin, $connAdmin);
   $Result1 = mysql_query($updateSQL, $connAdmin) or die(mysql_error());

   //$updateGoTo = "confirmation"; WILL NEED TO CHANGE AS NEEDS TO GO TO PAYPAL


   if (isset($_SERVER['QUERY_STRING'])) {
     $updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
     $updateGoTo .= $_SERVER['QUERY_STRING'];
   }
   header(sprintf("Location: %s", $updateGoTo));
 }

This is my current form

 <form action="<?php echo $editFormAction; ?>" name="form" class="" id="form" method="POST" enctype="multipart/form-data">
 <input type="hidden" name="id" value="<?php echo $_SESSION['id']; ?>" readonly="readonly">
 <input type="hidden" name="payment_page_completed" value="yes" readonly="readonly">
 </form>

Thank you

  • 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-25T10:23:14+00:00Added an answer on May 25, 2026 at 10:23 am

    Yes you can do it in two ways by submitting form to two sides with two submits on one form, one to paypal and other to the page where you can save it in your db.

    EDIT 1:

    In your form add two submits like this:

    <input type="submit" name="submit" class="btns" id="submit1" value="Save in DB" onclick="changeWhere('http://yourwebsite.com/savedata.php');" >
    
    <input type="submit" name="submit" class="btns" id="submit2" value="Move to PayPal"
    onclick="changeWhere('https://www.paypal.com/cgi-bin/webscr');" disabled="true">
    

    and in your script add this:

    <script type="text/javascript">
    
    function changeWhere(place){
    
        document.form.action=place;   //use your forms name inplace of form
    
    }
    
    </script>
    

    EDIT 2:

    using single submit for two form actions

    add this in your form:

    <input type="button" value="Submit" onclick="submitTwice(this.form)">
    

    and in script add this:

    <script type="text/javascript">
     function submitTwice(form){
     form.action = 'https://www.paypal.com/cgi-bin/webscr';
     form.submit();
     form.action = 'savedata.php';
     form.submit();
    }
    </script>
    

    It works for me. 🙂

    EDIT 3:

    savedata.php may include code like;

    <?php
    $item_name   = $_POST['item_name'];
    $item_price  = $_POST['item_price'];
    $item_number = $_POST['item_number'];
    
    $sql="Insert into sales (name, price, number) values ('$item_name', '$item_price', '$item_number')";
    $result=mysql_query($sql);
    ?>
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page using Paypal Payments Standard with buy one now buttons on
If I use the completely free service Paypal Standard Payment together with Drupal Ubercart
I am trying to integrate a PayPal Website Payments Standard > Cart Upload payment
I have seen and know how to use IPN for paypal payments but I
I need a logging library for my multi-threaded Tcl aplication. Can I use standard
I want to use Paypal Payment Standard(the one jumps to paypal to pay and
i m using paypal Standard as a payment gateway, i need to use recurring
From what I've been testing it seems that you can only use standard SQL
I am currently using PayPal's Website Payments Standard to accept credit cards on my
I have an assignment, This is my HashMap initialization.. I can only use standard

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.