Note that there are some explanatory texts on larger screens.

plurals
  1. POSubmit PayPal form & Update Database at same time
    primarykey
    data
    text
    <p>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?</p> <p>This is the standard PayPal payment form I want to use - Will change as necessary..</p> <pre><code> &lt;form action="https://www.paypal.com/cgi-bin/webscr" method="post" id="payPalForm"&gt; &lt;input type="hidden" name="item_number" value="01 - General Payment to FreelanceSwitch.com"&gt; &lt;input type="hidden" name="cmd" value="_xclick"&gt; &lt;input type="hidden" name="no_note" value="1"&gt; &lt;input type="hidden" name="business" value="your@paypalaccount.com"&gt; &lt;input type="hidden" name="currency_code" value="USD"&gt; &lt;input type="hidden" name="return" value="http://freelanceswitch.com/payment-complete/"&gt; Item Details:&lt;br /&gt;&lt;input name="item_name" type="text" id="item_name" size="45"&gt; &lt;br /&gt;&lt;br /&gt; Amount: &lt;br /&gt;&lt;input name="amount" type="text" id="amount" size="45"&gt; &lt;br /&gt;&lt;br /&gt; &lt;input type="submit" name="Submit" value="Submit"&gt; &lt;/form&gt; </code></pre> <p>This is my update coding in my page:</p> <pre><code> $editFormAction = $_SERVER['PHP_SELF']; if (isset($_SERVER['QUERY_STRING'])) { $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']); } if ((isset($_POST["MM_update"])) &amp;&amp; ($_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, '?')) ? "&amp;" : "?"; $updateGoTo .= $_SERVER['QUERY_STRING']; } header(sprintf("Location: %s", $updateGoTo)); } </code></pre> <p>This is my current form</p> <pre><code> &lt;form action="&lt;?php echo $editFormAction; ?&gt;" name="form" class="" id="form" method="POST" enctype="multipart/form-data"&gt; &lt;input type="hidden" name="id" value="&lt;?php echo $_SESSION['id']; ?&gt;" readonly="readonly"&gt; &lt;input type="hidden" name="payment_page_completed" value="yes" readonly="readonly"&gt; &lt;/form&gt; </code></pre> <p>Thank you</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload