• 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: Form values in 'Script called on form process'

Form values in 'Script called on form process' 14 years 1 month ago #9998

  • goslingcools
  • goslingcools's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 10
  • Thank you received: 1
How can I use the form values in my custom php?

I put some php code under 'Script called on form process' but I can't retrieve the form values.

How can I retrieve for example the value of a field called email_address and use this value in my custom php code?

Regards,

Gosling Cools
The administrator has disabled public write access.

Re:Form values in 'Script called on form process' 14 years 1 month ago #10037

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

You can simply use the following syntax:
$_POST['form']['email_address']

You can view the exact structure of the $_POST variable by using something like this (in the Scripts called on form process area):
print_r($_POST);die();
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Re: Form values in 'Script called on form process' 12 years 2 months ago #16426

  • james65
  • james65's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
I've created a form with two checkbox groups. That returns two delimited lists of ticked entries, which I want to cat together into a single list, and then parse into an array and write back to the database.

I've written something like this in the 'Script called on form process' area:

$allmembers= $_POST ."|". $_POST;
$member = explode("|",$allmembers);
$att=1;


I want to write $member and $att to a table, but they're not listed in the SQL mapping area.

So I've tried adding this to the code:

for($i=0; $i<count($member);$i++)
{
$db=& JFactory::getDBO();
$db->setQuery("INSERT INTO attendance SET id = '".$member[$i]."', IdEvent = '".$_POST."', AttStatus = '".$att."'");
}


I can't tell where this is failing, or whether there's more than one thing wrong with it. Is my code wrong, or am I trying to put it in the wrong place? Or both?
Last Edit: 12 years 2 months ago by james65. Reason: misprint
The administrator has disabled public write access.

Re: Form values in 'Script called on form process' 12 years 2 months ago #16429

  • james65
  • james65's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
I've found a workaround - I'll write the delimited string to a temporary SQL table, and then create a custom SQL function to parse it there.

Not a pretty solution, but it gets me what I want.
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!