Welcome and have a nice stay !       login   register   need help?  

 Page Info

Page Title: PHP FormMailer
Description: This is a very simple php form mailer that you can use to gather feedback from visitors to your site.
Author: tefra
Submission Date: 23-07-2005 09:59

 Rating & Comments

View or add comments: (0)
Average members rating: 0



This is a very simple php form mailer that you can use to gather feedback from visitors to your site. It checks that the user has entered text into the name and email fields, but it does not check for a valid email address, or require that the user leave a comment (see below to change that option).

To use the form, simply "select all" in the box below, and cut and paste the code into a text editor. Insert your information into the $sendto="", $emailsubject="" and $thankyou="" values in the top three lines of the code, save the file as form.php (or any filename.php that you choose) and upload it to your site.

To require that the comment field be completed, replace this line:

Code :
// hide source code
// hide line numbers

1  $comments="The visitor did not comment."



with this line:

Code :
// hide source code
// hide line numbers

1  $message="Please leave a comment."



Code :
// hide source code
// hide line numbers

 1  <?
 2  $sendto
="you@yourdomain.com";
 3  
$emailsubject="Response from the feedback form.";
 4  
$thankyou="Your message been sent, thank you!";
 5  
 6  if (
$submit) {
 7  
 8     if (
$visitorName <= "")
 9         
$message="Please enter your name.";
10     else if (
$visitorEmail <= "")
11         
$message="Please enter your email address.";
12     else if (
$comments <= "")
13        
$comments="The visitor did not comment.";
14     if (
$message)
15        echo (
$message);
16     else {
17        
mail("$sendto",
18        
"$emailsubject",
19        
"rnName: $visitorNamernEmail: $visitorEmailrnComments:rn$comments",
20        
"From: $visitorName <$visitorEmail>");
21        echo (
"<br /><br />     $thankyou");
22        die();
23     }
24  }
25  
?>
26  

27  <form method="post">
28  <p>
29  <font face="Verdana,sans serif" size="2">
30  Your Name:
31  </font>
32  <br />
33  <input type="text" size="40" name="visitorName">
34  <br />
35  <font face="Verdana,sans serif" size="2">
36  Your email address:
37  </font>
38  <br />
39  <input type="text" size="40" name="visitorEmail">
40  <br />
41  <font face="Verdana,sans serif" size="2">
42  Comments:
43  </font>
44  <br />
45  <textarea name="comments" cols=30 rows=10></textarea>
46  <p>
47  <input type="submit" name="submit" value="submit form">
48  </form>




You can change the appearance somewhat by making changes to the html portion of the file.

Donation:

If you like our free quality work, make a donation by using Paypal and tell us what you would like to see improved on our site for the next few months.

Comments


No comments yet

 Site Activity
Currently online: 0 member(s), 40 guest(s) : All members offline.


 Quick Menu
sitemap
search
galleries
main
forums


 Our Services

Main Projects
Designers For Hire
Unique LDU Skins
LDU Skins For Sale
Seditio Skins For Sale
Templates For Sale


 Statistics
18582 registered members,
1870 topics in forums,
21584 posts in forums,
13589670 pages served since 2004-05-09.
more


 7th Version Design

+++
top