Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>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.</p> <p>EDIT 1:</p> <p>In your form add two submits like this:</p> <pre><code>&lt;input type="submit" name="submit" class="btns" id="submit1" value="Save in DB" onclick="changeWhere('http://yourwebsite.com/savedata.php');" &gt; &lt;input type="submit" name="submit" class="btns" id="submit2" value="Move to PayPal" onclick="changeWhere('https://www.paypal.com/cgi-bin/webscr');" disabled="true"&gt; </code></pre> <p>and in your script add this:</p> <pre><code>&lt;script type="text/javascript"&gt; function changeWhere(place){ document.form.action=place; //use your forms name inplace of form } &lt;/script&gt; </code></pre> <p>EDIT 2:</p> <p>using single submit for two form actions</p> <p>add this in your form:</p> <pre><code>&lt;input type="button" value="Submit" onclick="submitTwice(this.form)"&gt; </code></pre> <p>and in script add this:</p> <pre><code>&lt;script type="text/javascript"&gt; function submitTwice(form){ form.action = 'https://www.paypal.com/cgi-bin/webscr'; form.submit(); form.action = 'savedata.php'; form.submit(); } &lt;/script&gt; </code></pre> <p>It works for me. :-)</p> <p>EDIT 3:</p> <p>savedata.php may include code like;</p> <pre><code>&lt;?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); ?&gt; </code></pre> <p>Hope this helps.</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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      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