The Form Tools forums are no longer active, but the old posts have been archived here. Please see the Help page on how to get help / report issues.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calling a php script when form is submitted

I'm willing to have a script started when the user submit his form.

The php code is in a separate file I'd like to call, and uses many other librairies and variables from the form.

I can't get it done. I've looked through the hook manager module, but I can't have it work properly...

Any ideas?

Thanks for the help!
Is this for an internal form or an external form?
It's for an external form
For an external form, the easiest way i have found is tois to call it in the thank you page. What kind of script are you running on submit?
Thanks for the reply. I'm pretty new in using formtools. Do you mean directly inserting the script in "publish/THANKYOU PAGE CONTENT" (form builder module)?

It's this kind of script (month being a $ of the form):

require_once './PHPWord/PHPWord.php';

$PHPWord = new PHPWord();

$document = $PHPWord->loadTemplate('./Template/template.docx');

$document->setValue('Value1', 'month');


I wanted to attach the file created directly with the email sent
Ahh gotcha, I always forget about the formbuilder module. I would have to do some research on how that works, I've never used it. I know it has some reduced flexibility when it comes to stuff like this. If I have time tonight I'll take a look and see if there's an easy way to do it.

Check out

You may be able to insert it in the template there.
Ok thanks!

couldn't find where/which template I should insert it in...

Do you have any ideas?

I'm not in front of my computer but this should help. Let me know if you can't find it.
Yep found it! Thanks!

Looks like I need to add {{ and }} to every line to get it interpreted, right?
I'm not sure. I really need to play with formbuilder so I can help answer some of these questions!

Forum Jump:

Users browsing this thread: 1 Guest(s)