
September 30th, 2004, 10:11 AM
|
|
Contributing User
|
|
Join Date: Apr 2007
Location: belfast
Posts: 50
Time spent in forums: 9 h 50 m 7 sec
Reputation Power: 2
|
|
|
simple php formmail
here is a simple php formmail for those who need it
this will be a contact formail but it is easy to edit so you can do what you want with it.
---------------------------------------------
here is the form
---------------------------------------------
php Code:
Original
- php Code |
|
|
|
</p> <form name="form1" method="post" action=""> <p> <p><B>Name::: </B> <INPUT TYPE = "text" NAME = "name" /> </p> <p> <B>Email::: </B> <INPUT TYPE = "text" NAME = "email" /></p> <p><strong>Comments:</strong><br> <textarea name="comments" cols="50" rows="15" id="Comments"></textarea> </p> <p> <input type = "submit" name = "submit" value = "Submit"/> </p> </form> ###################### here is the code to send the info to your emial address and to also check for errors ###################### <?php if ($submit) { // if this is submited // error messages (if nothing in box sends error) // if ($name <= "") $error = "Please enter Name"; else if ($email <= "") $error = "Please enter Email"; else if ($comments <= "") $error = "please enter a Comment"; if ($error) // if there is a error else { // and if there not do this mail("Youremial@emailhost.com", "Contact", "name: $namenemail: $emailncomments: $comments", "From: $name <$email>"); Echo("Thank you $name,nyour information has been sent thank you."); } } ?>
----------------------------------------------
don't forget to put your email address in
|