• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: When does script execute....?

When does script execute....? 16 years 2 months ago #6553

In the PHP Scripts section, under the "Script called on form process" box, when does that code get executed? I assumed it processed after the form submission, but noticed it processes on form page load. Is this supposed to happen this way? If so, how can I execute PHP code after the submit button is pressed?
Thanks,
Keith
The administrator has disabled public write access.

Re:When does script execute....? 16 years 2 months ago #6646

Sorry for the bump, but are there any takers for this?
The administrator has disabled public write access.

Re:When does script execute....? 16 years 2 months ago #6659

  • ryanm
  • ryanm's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
i found this same issue... and found a solution

I tried wrapping the process script I wrote in:

if(isset($_POST))
{

/* your script here */


}

where the 'submit' is name of the submit var you used. It did work, so you might want to give it a try

Ryan
The administrator has disabled public write access.

Re:When does script execute....? 16 years 2 months ago #6661

Great... Thanks for the tip, Ryan.

-Keith
The administrator has disabled public write access.

Re:When does script execute....? 15 years 7 months ago #8572

  • wiese_john
  • wiese_john's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 1
I hope someone can help. I tried the advice of Ryan and I am still not having any luck with executing the script. I am not a PHP developer so maybe I have something wrong in my script.
if(isset($_POST))
{
$business = ' This e-mail address is being protected from spambots. You need JavaScript enabled to view it ';
$item_name = 'Camp';
$currency_code = 'USD';
if ($_POST) = '5 days per week - $299'
{ $amount = $_POST;
if ($_POST) = '4 days per week - $240'
{ $amount = $_POST;
if ($_POST) = '3 days per week - $199'
{ $amount = $_POST;
if ($_POST) = 'Special Program'
{ $amount = $_POST;
header('Location: www.paypal.com/cgi-bin/webscr?cmd=_xclic...e.'&amount='.$amount);
exit();
}
The administrator has disabled public write access.

Re:When does script execute....? 15 years 7 months ago #8604

  • alexp
  • alexp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 2253
  • Thank you received: 180
Hello,

I presume you are actually using RSform!Pro, not RSForm!...

From what i can see you have some syntax errors... If you are using this in the Scripts called on form process or Scripts called after form process you can simply use the following script:
$business = 'email@gmail.com';
$item_name = 'Camp';
$currency_code = 'USD';
if ($_POST['form']['ptype']) = '5 days per week - $299'
	$amount = $_POST['form']['ptype5day'];
if ($_POST['form']['ptype']) = '4 days per week - $240'
	$amount = $_POST['form']['ptype4day'];
if ($_POST['form']['ptype']) = '3 days per week - $199'
	$amount = $_POST['form']['ptype3day'];
if ($_POST['form']['ptype']) = 'Special Program'
	$amount = 'numeric value here';
header('Location: www.paypal.com/cgi-bin/webscr?cmd=_xclick&business='.$business.'&item_name='.$item_name.'&currency_code='.$currency_code.'&amount='.$amount);
exit();
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
Last Edit: 15 years 7 months ago by alexp.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!