Note that there are some explanatory texts on larger screens.

plurals
  1. POPOST FROM immediately
    primarykey
    data
    text
    <p>I have a Paypal class and I would like to echo the form and then submit it after the user click pay. I've tried the javascript but it didn't work with me.</p> <pre><code>if(isset($_SESSION['user_id'])) { include('includes/class_paypal.php'); include 'includes/class_order.php'; include 'includes/class_user.php'; include 'includes/class_permission.php'; include('includes/adminfunctions_status.php'); $invoice = new paypal(); $order = new order($_GET['pay']); $invoice-&gt;custom = $_GET['pay']; $invoice-&gt;amount = $order-&gt;price; $invoice-&gt;item_name = 'Order #'.$order-&gt;id.''; $invoice-&gt;item_number = $order-&gt;id; $invoice-&gt;init(); } ?&gt; &lt;script type="text/javascript"&gt; $(document).ready(myfunc () { var frm = document.getElementById("order"); frm.submit(); } &lt;/script&gt; </code></pre> <p>PayPal Class</p> <pre><code> var $cmd = "_xclick"; var $business = "**"; var $item_name; var $item_number; var $amount; var $no_shipping = 1; var $no_note = 1; var $currency_code = "USD"; var $lc = 'US'; var $bn = "PP-BuyNowBF"; var $return; var $cancel_return; var $rm = 2; var $notify_url; var $custom; function init() { echo ' &lt;form id="order" target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"&gt; &lt;input type="hidden" name="cmd" value="_cart"&gt; &lt;input type="hidden" name="business" value="'.$this-&gt;business.'"&gt; &lt;input type="hidden" name="item_name" value="'.$this-&gt;item_name.'"&gt; &lt;input type="hidden" name="item_number" value="'.$this-&gt;item_number.'"&gt; &lt;input type="hidden" name="amount" value="'.$this-&gt;amount.'"&gt; &lt;/form&gt; '; } </code></pre> <p>as you can see I want to post the form after initialize the order information. So when the user go to index.php?pay=45 (45 is the order number ) I want the file to show the form and everything, and then post the form to Paypal.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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