RQ: Form to e-mail script

  • mexus
  • Born
  • Born
  • mexus
  • Posts: 4
  • Loc: In the spirit of WWW!

Post 3+ Months Ago

I need a working form to e-mail script.






Sorry if there is another topic asking for the same, but my connection is very slow (it loads one page 5 min - international internet).
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

Are you just looking for an opensource, freely available script, or are you looking to pay somebody to custom-code one?
  • CazpianXI
  • Proficient
  • Proficient
  • User avatar
  • Posts: 285

Post 3+ Months Ago

Here's a simple PHP script that I use:

Code: [ Select ]
<html>
<head>
<title>Thank You!</title>
</head>

<h1 align="center"><font face="comic sans ms" color="#FF0000">Thank You!</font></h1>

<p>We greatly appreciate your feedback about this Web site. We will take your comments into consideration. Thank you again for your time to help us improve this site!</p>
<p><i>--Webmaster</i></p>

<html>
<body bgcolor="#FFFFFF">
<p>
<?
$MailToAddress = "YOUR@EMAIL.COM";
$MailSubject = "NaudusFamily.com Feedback";
  if (!$MailFromAddress) {
  $MailFromAddress = "feedback@naudusfamily.com";
  }
$Header = "";
$Footer = "";
?>
<?
  if (!is_array($HTTP_POST_VARS))
  return;
reset($HTTP_POST_VARS);
  while(list($key, $val) = each($HTTP_POST_VARS)) {
  $GLOBALS[$key] - $val;
  $val=stripslashes($val);
  $Message .= "$key = $val\n";
  }

  if ($Header) {
  $Message = $Header."\n\n".$Message;
  }

  if ($Footer) {
  $Message .= "\n\n".$Footer;
  }

mail( "$MailToAddress", "$MailSubject", "$Message", "From: $MailFromAddress");
?>
</p>
<br><br>
<h2>Thank You!</h2>
</td>
</tr>
</table>
</body>
</html>
  1. <html>
  2. <head>
  3. <title>Thank You!</title>
  4. </head>
  5. <h1 align="center"><font face="comic sans ms" color="#FF0000">Thank You!</font></h1>
  6. <p>We greatly appreciate your feedback about this Web site. We will take your comments into consideration. Thank you again for your time to help us improve this site!</p>
  7. <p><i>--Webmaster</i></p>
  8. <html>
  9. <body bgcolor="#FFFFFF">
  10. <p>
  11. <?
  12. $MailToAddress = "YOUR@EMAIL.COM";
  13. $MailSubject = "NaudusFamily.com Feedback";
  14.   if (!$MailFromAddress) {
  15.   $MailFromAddress = "feedback@naudusfamily.com";
  16.   }
  17. $Header = "";
  18. $Footer = "";
  19. ?>
  20. <?
  21.   if (!is_array($HTTP_POST_VARS))
  22.   return;
  23. reset($HTTP_POST_VARS);
  24.   while(list($key, $val) = each($HTTP_POST_VARS)) {
  25.   $GLOBALS[$key] - $val;
  26.   $val=stripslashes($val);
  27.   $Message .= "$key = $val\n";
  28.   }
  29.   if ($Header) {
  30.   $Message = $Header."\n\n".$Message;
  31.   }
  32.   if ($Footer) {
  33.   $Message .= "\n\n".$Footer;
  34.   }
  35. mail( "$MailToAddress", "$MailSubject", "$Message", "From: $MailFromAddress");
  36. ?>
  37. </p>
  38. <br><br>
  39. <h2>Thank You!</h2>
  40. </td>
  41. </tr>
  42. </table>
  43. </body>
  44. </html>
  • mexus
  • Born
  • Born
  • mexus
  • Posts: 4
  • Loc: In the spirit of WWW!

Post 3+ Months Ago

Axe wrote:
Are you just looking for an opensource, freely available script, or are you looking to pay somebody to custom-code one?


I'm looking for a free script for the newspapper site of my school.
So thah visitors may send us info, using a webform directly to the e-mail!
  • CazpianXI
  • Proficient
  • Proficient
  • User avatar
  • Posts: 285

Post 3+ Months Ago

mexus wrote:
I'm looking for a free script


Maybe I didn't make my post clear enough - the script I posted above is 100% free for you to use.

To implement is, just copy and paste the code into a page, say "feedback.php". Then, insert this code into the page that has the form for the user to fill out:

Code: [ Select ]
<form method="POST" action="feedback.php">
...
<!-- insert any fields you want here-->
</form>
  1. <form method="POST" action="feedback.php">
  2. ...
  3. <!-- insert any fields you want here-->
  4. </form>


Of corse, make sure that you upload "feedback.php" to the same directory that you uploaded the page that has the form for the users to fill out. (If they're not in the same directory, you'll have to edit the "action" attribute in the above form)

Just make sure to replace "YOUR@EMAIL.COM" with your email address (in feedback.php). ;)

Do this, and everytime someone fills out the form, this script will email you the results. (Real simple)

Take, use and enjoy!

Hope this helps.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 78 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.