Unfortunately, the username and password you have entered do not match!

Registration

Unfortunately, this username is already taken!

Unfortunately, this e-mail address is already used!

Please retype the verification code.

All fields are required

Form values in 'Script called on form process'

Welcome, Guest
Username Password: Remember me

Form values in 'Script called on form process'
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: Form values in 'Script called on form process'

Form values in 'Script called on form process' 2 years, 2 months ago #9998

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

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

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

Re: Form values in 'Script called on form process' 3 months ago #16426

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['form']['memberlist 1'] ."|". $_POST['form']['memberlist 2'];
$member = explode("|",$allmembers);
$att=1;


I want to write $member[i] 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['form']['Event']."', 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: 3 months ago by James Hawkins. Reason: misprint

Re: Form values in 'Script called on form process' 3 months ago #16429

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.

Re: Form values in 'Script called on form process' 5 hours, 1 minute ago #0

Hello,
This is an automatically generated message.
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 wish to receive our 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: http://www.rsjoomla.com/support-policy.html.

Thank You!
PLEASE NOTE: This topic is NOT locked and you can add replies to it. Other users are free to reply as well. This message has been generated by a bot and has no effect on the topic whatsoever.
  • Page:
  • 1
Time to create page: 1.07 seconds
Feedback