Action form using php

65 views
Skip to first unread message

Juan Carlos Garcia

unread,
Jul 27, 2012, 3:42:22 AM7/27/12
to kurog...@googlegroups.com
Hello everyone:

Could anybody help me please, I have an html form in a tpl file, but in the action parameter how can I redirecto to a php file that I create and where that file must be located?

Thank you,
Best regards,
JC 

Michael

unread,
Jul 27, 2012, 7:03:53 AM7/27/12
to kurog...@googlegroups.com
The file can be located anywhere as long as you use the full URL to point to it. However I prefer to keep all my php scripts in the 'www' folder as this is the root for mobile site server. 

To prevent issues with the main Kurogo file setup I created a folder called 'custom_scripts' (but you can call it anything as long as it is not a folder name already used by Kurogo, for example you should not call it 'map' as this will interfere with the map module).

Then just store your scripts in there, the URL will begin with the root URL of your site with "/custom_scripts/[script_name]" appended. For example:


Obviously replace the "server.universitas.com/mobile" with your server address I hope that makes sense.

Michael

matt

unread,
Jul 27, 2012, 8:17:04 AM7/27/12
to kurog...@googlegroups.com
I prefer to keep it in a module, so for instance there is a module "helloworld". In the site/app/modules/helloworld folder place a "templates" folder and put your template "formname.tpl" there. Have it submit to something like "formname-submit". (This will resolve to "/helloworld/form-submit) Then in the "initializeForPage()" function for this helloworld module make a "switch/case 'formname-submit':". Place your logic for the form here. You'll also want to add a blank "formname-submit.tpl" file so the system doesn't bark at you.

Juan Carlos Garcia

unread,
Jul 27, 2012, 1:08:27 PM7/27/12
to kurog...@googlegroups.com
Thank you very much Mike, The issue has been solved!

Juan Carlos García Sánchez
Tecnologías de Información
UNIVERSIDAD PANAMERICANA
Campus Bonaterra
9106200 Ext 7270

Juan Carlos Garcia

unread,
Jul 27, 2012, 1:09:16 PM7/27/12
to kurog...@googlegroups.com
Thank you very much Matt! I am trying this method.
Best regards,
 
Juan Carlos García Sánchez
Tecnologías de Información
UNIVERSIDAD PANAMERICANA
Campus Bonaterra
9106200 Ext 7270


Reply all
Reply to author
Forward
0 new messages