PHP Code Execution on form submission

Status
Not open for further replies.

thirdhatch

New Member
I have just installed Fabrik and it looks like it will do exactly what I was looking for.

I am wondering how experimental the experimental PHP code execution is.

My specific question is, can the experimental code include variables from the form that has just been filled out?
 
It's not really experimental at all any more, that feature has been heavily used. We should really take the 'experimental' comment out.

Yes, you have access to anything you need from Fabrik or Joomla, although depending on the scope you may need to global it in. Your code is simply eval'ed at whatever point in the form processing process you select in the "Process CURL script" dropdown.

Form data is in the aData[] array, referenced by element name, so aData['foobar'] would be the 'foobar' element data. If you select 'before form is processed', you can modify the aData values, and your modified values will be saved.

NOTE - remember that if you select a CURL option for "Process CURL script", processing of the form stops immediately after your code is run. If you just want to run some PHP and continue with form processing, select a "simple eval" option.

If you do want to do CURL processing, you can optionally specify your target in the 'jump page', and Fabrik will provide a $ch, curl_init'ed to that URL for you. Or you can just handle that stuff yourself.

If you want to look under the hood in more detail to see how this stuff is processed, the place to look is in the processForm() function in fabrik.class.php (in the front end component folder).

-- hugh
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top