Form to html and php | Html to mail
A kind formmail.php user has sent me his variation of formmail.php with this email. This is not an official release but it may help you out. Please read the email below explaining.
- (phantom) Jack
09/03/2011 - New updates!
We found a few great websites they have really great information on health and treatments and it is worth checking them if they are for you.
or without highlighting.
Form to email Documentation still applies.
I've been using formmail 5.0 since probably around the same time that it it was put out. Around late 2003 to early 2004. Out of box, I found it rather easy to setup and use, but had some minor faults to it that I could live with.
Over the past year, I've had more and more that I needed to be able to do with it, so I started making modifications to it as needed. I know you haven't done much with it since 2003, or at least not on dtheatre.com/scripts/, so I thought I would write, inform you of what modifications I've done, and give a few suggestions.
I am attaching my version of it for you to look at if you have time. Many of my modifications have been for a particular need, so many can probably be discarded as insignificate to function, however there are a few that I would suggest incorporating.
I've tried to comment everywhere I've made changes, however, some minor things may not be commented.
Line numbers are based on my modified version...
The biggest suggestions are:
Line 103 - Banning by IP address (This is the array, banning code starts on line 246, is ran as a function like banning by email, its called on line 266)
Line 117 - print_error function ( When using custom error pages, looks to see if it already has a ? and will put &error= instead of ?error=)
(Did this because I kept getting errors the way I'm doing valid url checking, kept sending me to my custom 404 error page)
Line 412 - The header section for putting in TO: has been removed because with this there it was sending two messages out and two AR's. It gets the info from $reciepient or the email addy, so really doesn't need to be in header info too.
Line 418 - moved further down.(was somewhere above the FROM: line) was causing users email addy not to be displayed when messages were recieved in Outlook Express
Line 511 - Did same with Required fields as I did with print_error function, due to ?error= causing problems, had it look to see if PHP was already passed parm on url and use & instead if it is.
Line 576 - Changed the phone verification from ereg to preg_match and it actually works, where the original one, which is just commented out, was allowing invalid phone numbers. IE: 444-444-4444555 was allowed as a valid phone number, now if it's not in the format of ###-###-#### it will not accept it. (Also added other phone numbers right underneath that, but was for a specific need.)
MOST OF ALL!!!
Starting on Line 268, the parse_form function has been modified, not by me, but someone helped me greatly with it which those comments are noted, more for my benefit than anything else. parse_form function has been modified on Lines 305, 306, 325 and 326 to allow a form input name to be an array with a string key. I was having the dickens of a time with this one and someone else helped me out greatly. Main purpose for me was check boxes that on error needed to be checked when formmail passes back to the form. I've got error codes on my form page which will tell the person where they messed up on the page, which as you will see is now being passed back to the form through a SESSION.
(Personal Additions I think are useful, but not sure how you could do them universally)
Starting Line 477 - Have a "$requireone" which is getting from the from. Uses are obvious. Form has 3 phone numbers, this section guarentees that one is listed, but not necesarily requiring all of them. Which is why variable $requireone. I use to to verify they've checked at least one checkbox for their os_version also. Not sure how this could be worked in more universally if you were interested in something like this as it is very specific to my needs. Also having it pass as &missing= instead of &error= as the error messages on the form are different for error in format or other error vs. the field is just plain missing.
Thanks for listening,