Reputation: 297
Here is the scenario that i am working with and currently stuck at a point.
Joomla article calls a HTML form using sourcerer plugin. SO in the article i have something like [source] << include form.html >> [/source]
On submit, Form.html send a AJAX POST call to a PHP file updates a Db table and then opens a new URL which is a payment gateway.
<-- This is where my problem lies -->
I need to capture this transaction id and print it in the article saying "Thank you for your payment. Your transaction id is xxxxxxxx ".
How should i proceed with the development ? How can i capture the POST / GET parameters in the Joomla article ?
Can anyone help me here?
Thanks in advance.
BR Nilesh
Upvotes: 0
Views: 742
Reputation: 300
If you are already using Sourcerer in your articles you should be able to embed your PHP code between your [sourcerer][/sourcerer] tags. The following PHP code will all you to query the post variables in your URL:
$JInput = JFactory::getApplication()->input;
$trxid = $JInput->get('trxid','','int');
$uniqueid = $JInput->get('uniqueid','','int');
That will set your values to the variables $trxid and $uniqueid. From there you can print them in your article using the sourcerer tags and an echo or print statement.
Change the 'int' to 'string' if those fields may be alphanumeric mixed strings.
Cheers and Good Luck
Here is the link for the Joomla documentation on using JInput as well for future use if you need it. Using JInput with Joomla
Upvotes: 1