User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 456,485 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,793 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser: Programming Forums

Dreamweaver email forms

Join Date: Feb 2007
Posts: 4
Reputation: TrailBlazer is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
TrailBlazer TrailBlazer is offline Offline
Newbie Poster

Re: Dreamweaver email forms

  #11  
Feb 6th, 2007
Originally Posted by bkendall View Post
your form page will be just like any other page except that it will have form tags

<form name="form1" id="form1" method="post" action="">
  Field Name: 
  <input name="field name" type="text" id="field name" />
</form>

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

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
	"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>Contact Form</title>
<meta http-equiv="Content-Type" 
   content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
   if ($_SERVER['REQUEST_METHOD'] != 'POST'){
      $me = $_SERVER['PHP_SELF'];
?>
   <form name="form1" method="post"
         action="<?php echo $me;?>">
      <table border="0" cellspacing="0" cellpadding="2">
         <tr>
            <td>Name:</td>
            <td><input type="text" name="Name"></td>
         </tr>
         <tr>
            <td>Subject</td>
            <td><input type="text" name="Subject"></td>
         </tr>
         <tr>
            <td valign="top">Message:</td>
            <td><textarea name="MsgBody"></textarea></td>
         </tr>
         <tr>
            <td>&nbsp;</td>
            <td><input type="submit" name="Submit"
               value="Send"></td>
         </tr>
      </table>
   </form>
<?php
   } else {
      error_reporting(0);
      $recipient = 'me@myaddress.com';
      $subject = stripslashes($_POST['Subject']);
      $from = stripslashes($_POST['Name']);
      $msg = "Message from: $from\n\n".stripslashes($_POST['MsgBody']);
      if (mail($recipient, $subject, $msg))
         echo nl2br("<b>Message Sent:</b>
         To: $recipient
         Subject: $subject
         Message:
         $msg");
      else
         echo "Message failed to send";
}
?>
</body>
</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.



This was the best help. In a matter of a few minutes I had this email form up and running inside a table on my site. Thanks!

I do have a ? though. Is it possible to somehow encrypt or 'hide' the email address that receives the form? (So it does not get crawled and spammed)


Thanks again!
Reply With Quote  
All times are GMT -4. The time now is 2:59 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC