View Single Post
Join Date: Jul 2005
Posts: 69
Reputation: bkendall is an unknown quantity at this point 
Solved Threads: 0
bkendall's Avatar
bkendall bkendall is offline Offline
Junior Poster in Training

Re: Dreamweaver email forms

 
0
  #4
Jul 12th, 2005
your form page will be just like any other page except that it will have form tags

  1.  
  2. <form name="form1" id="form1" method="post" action="">
  3. Field Name:
  4. <input name="field name" type="text" id="field name" />
  5. </form>

the action=''''> is where you would need to use a langauge such as php which might look like this:

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
  2. "http://www.w3.org/TR/REC-html40/loose.dtd">
  3. <html>
  4. <head>
  5. <title>Contact Form</title>
  6. <meta http-equiv="Content-Type"
  7. content="text/html; charset=iso-8859-1">
  8. </head>
  9. <body>
  10. <?php
  11. if ($_SERVER['REQUEST_METHOD'] != 'POST'){
  12. $me = $_SERVER['PHP_SELF'];
  13. ?>
  14. <form name="form1" method="post"
  15. action="<?php echo $me;?> ">
  16. <table border="0" cellspacing="0" cellpadding="2">
  17. <tr>
  18. <td> Name:</td>
  19. <td> <input type="text" name="Name"> </td>
  20. </tr>
  21. <tr>
  22. <td> Subject</td>
  23. <td> <input type="text" name="Subject"> </td>
  24. </tr>
  25. <tr>
  26. <td valign="top"> Message:</td>
  27. <td> <textarea name="MsgBody"> </textarea> </td>
  28. </tr>
  29. <tr>
  30. <td> &nbsp;</td>
  31. <td> <input type="submit" name="Submit"
  32. value="Send"> </td>
  33. </tr>
  34. </table>
  35. </form>
  36. <?php
  37. } else {
  38. error_reporting(0);
  39. $recipient = 'me@myaddress.com';
  40. $subject = stripslashes($_POST['Subject']);
  41. $from = stripslashes($_POST['Name']);
  42. $msg = "Message from: $from\n\n".stripslashes($_POST['MsgBody']);
  43. if (mail($recipient, $subject, $msg))
  44. echo nl2br("<b>Message Sent:</b>
  45. To: $recipient
  46. Subject: $subject
  47. Message:
  48. $msg");
  49. else
  50. echo "Message failed to send";
  51. }
  52. ?>
  53. </body>
  54. </html>

You will need to check if you have access to a php server if not there are other methods that you can use. If all else fails you can send it via javascript, which is a dirty way to do it but will work.
Reply With Quote