Most are usually CGI, Perl or some other chaotic programming language

So here is my php version that works with any form as long as you have a few certain things in place? which hopefully I will explain well enough for anybody to understand.
HTML
First, in your html form? make sure the form tag looks something like this:
- Code: Select all
<form action="./formmail.php" enctype="application/x-www-form-urlencoded" method="post">
make sure to change ./formmail.php to the path to the php form mail script.
Then your form can be any way you like it? until the end.
Here is how the end of the form works.
Change abc to code setup for recipient in formmail.php.
- Code: Select all
<input type="hidden" name="rcp" value="abc" />
Change abc to code setup for tld in formmail.php
- Code: Select all
<input type="hidden" name="tld" value="abc" />
Change "this page" to the name of the page this is submitted from? for your reference.
- Code: Select all
<input type="hidden" name="location" value="this page" />
Change "my subject" to the subject you want the email to say when it reaches your inbox
- Code: Select all
<input type="hidden" name="subject" value="my subject" />
Change ./thanks.php to a page you have setup to display a successful submission message
- Code: Select all
<input type="hidden" name="redirect" value="./thanks.php" />
Only change the value to whatever you want displayed on the submit button.
- Code: Select all
<input type="submit" name="submit" value="Submit" />
Now that you have your html form in place? time for the php to take over.
I'm attaching formmail.php
Please note the 2 areas that need to be edited for this to work:
$recipient_array and $domain_array
Let me know if this helps or needs to be clarified.

Enjoy!

As always, if you use this, please either link back to startrekguide.com or donate to startrekguide.

















