PDA

View Full Version : New to formmail -- need help



breitman
20-Aug-2006, 10:59 AM
I am trying to use the formmail php script. In my environment we develop web sites and do so on a test server and then promote to production... We would like to be able to use relative paths so that the url pathing does not have to change (e.g., from btrassociates.btrtest.com to www.btrassociates.com (http://www.btrassociates.com/)) -- we also create many web sites and were planning on using the ini file to set the common special_fields like required, recipients, subject, and good_url...

Unfortunately I am struggling to get the script to work... I have been able to get it to send an email and errors emails also are sent. If I do not use good_url i get the default thank you and then it redirects itself to the formmail.php file and gets an error (page not found). If I do use the good_url (with relative or http:// pathing) it fails in the same manner, but I do not get the default thank you message

You may look at http://btrassociates.btrtest.com/sampleform.htm (http://btrassociates.btrtest.com/sampleform.htm) -- it is your sample form.... I have also modified http://btrassociates.btrtest.formmail.php (http://btrassociates.btrtest.formmail.php/) with our settings including DB_SEE_INI set to true so that I can see the formmail.ini file that is at http://btrassociates.btrtest.com/formmail.ini (http://btrassociates.btrtest.com/formmail.ini).

I am probably missing something basic... Help would be appreciated...

breitman
20-Aug-2006, 01:37 PM
well, I got the .ini file to be found... but I still cannot get the redirect upon success (good_url) to work... can this be a relaitve url like ./thankyou.htm? or thankyou.htm (since it is in the same dir as formmail.php)?

russellr
20-Aug-2006, 09:02 PM
Hi,

We have the same problem with URLs between our development environment and production.

For security and reliability reasons, FormMail works best when you configure and use it with full (absolute) URLs.

For simple tasks, relative URLs can work. I'm not sure why you're having problems with good_url, as this is a simple redirect.

However, as soon as you try to do advanced error handling (http://www.tectite.com/fmhowto/adverror.php) and certain other tasks, it doesn't work.

If you really want to automatically change URLs between development and production, it's best to convert your HTML to a simple PHP script which detects the environment and inserts the right URL in the right places.