Page 1 of 1

Can't get my php script to display results on same page

Posted: Sun Jan 07, 2007 5:15 am
by harleyquinn
I'm using this form mailer script from http://www.dagondesign.com/articles/secure-php-form-mailer-script/. The only way I could get it to work was by creating a UDT (user defined tag) which would call it from an external php file. (I tried putting the whole script in a UDT, but kept getting a 403 error message, also tried using {literal}{/literal} and even tried enabling {php} in the config file, but those methods didn't work either.)

Anyway, I was able to get the script to work, but the only problem I'm having is that I can't figure out how to get it to display the results on the same page where I placed the UDT calling the script. So for instance, after someone fills out the contact form and hits the submit button, it should display either an error message or a thank you message on the same page, http://www.domainname.com/contact/, but instead displays the message on the external php page [url=http://www.%20domainname.com/formmailerscript.php]http://www. domainname.com/formmailerscript.php[/url].

Any ideas? Has anyone else ever use this form mailer script from http://www.dagondesign.com/articles/secure-php-form-mailer-script/? Any insight would be greatly appreciated.

Re: Can't get my php script to display results on same page

Posted: Wed Jan 10, 2007 1:30 am
by JohnnyB
For some reason, the dagon site is down...  But, I've used that php form in another (non cmsms) project -- the wordpress version that is available.

Most likely, the source code of the php form will have to be modified. 

I strongly recommend using the Form Builder module that is available for CMS MS.  It is a great module with a lot of flexibility and customization.  It took a little time to wrap my head around the method to create and then build the form fields, but was easy to use afterwards.  I built my own template for the form and it the module provides everything needed to build a custom template.

http://dev.cmsmadesimple.org/projects/formbuilder

Re: Can't get my php script to display results on same page

Posted: Wed Jan 10, 2007 3:37 pm
by harleyquinn
I tried the Form Builder module and I couldn't for the life of me style the layout of the form. I too had a hard time wrapping my head around creating the template layout and then styling it with css. Got frustrated and ended up using the script from DagonDesign only because I've used it in the past and had success with it. I will give Form Builder a try once again.

Thanks.