Results 1 to 4 of 4

Thread: dreamweaver help, please!

  1. #1
    Right turn Clyde Nokia's Avatar
    Join Date
    Aug 2003
    Location
    Button Moon
    Posts
    1,696

    Question dreamweaver help, please!

    Hi all,

    I have developed my own site using dreamweaver and am having trouble with the method of submitting a form.

    I am a complete novice with dreamweaver and have pretty much taught myself with a few books etc. I have a "Contact Us" page which is a form that asked for deatils such as Name, Address Email addy etc.
    This works OK the problem I am having is with the submit button, when it is clicked it opens up the person default email program and obviously all the data they have just entered into the form is lost and they are left with a blank email.

    Does anybody know how I am meant to change the attributes of the submit button to have the data from the form emailed to me?

    I have included a screen shot of my settings at the moment! Not sure what other info is needed so please ask me if you need to know anything else!

    Off to search the web for an answer now, thought I would ask here firstfor a more accurate answer!

    Thanks!

    Nokia.

  2. #2
    In And Above Man Black Cluster's Avatar
    Join Date
    Feb 2005
    Posts
    912
    I think this need to be configured manually, you need to specify the SMTP address through which the email will be sent ... I can't help you much, coz I don't have Dreamweaver installed .... but I'm sure that this can be done through code manipulation ... you can find many free code snaps ...

    Cheers

    Links:

    1- http://www.mcps.k12.md.us/department...reamweaver.pdf
    2- http://www.sharkyforums.com/showthread.php?t=274131
    3- http://www.jqjacobs.net/web/forms.html
    \"The only truly secure system is one that is powered off, cast in a block of concrete and sealed in a lead-lined room with armed guards - and even then I have my doubts\".....Spaf
    Everytime I learn a new thing, I discover how ignorant I am.- ... Black Cluster

  3. #3
    Senior Member
    Join Date
    Mar 2005
    Posts
    175
    Hi Nokia,
    I think you are only using HTML pages but using a server technology, this work would be done lot easier. You can use any one you like php, asp.net or asp. All you need to do will post all the fields to a run-at-server page and that page could be used either to store data or send it as email.

    Here are some links:

    Sending mail using PHP - http://www.phpdig.net/ref/rn34re649.html
    Sending mail using ASP.net - http://www.developer.com/net/asp/article.php/3096831
    Sending mail using ASP - http://www.webwizguide.info/asp/tuto...l_tutorial.asp

    Although there many other methods to send emails in each case.


    Cheers!!
    \"And life is what we make it. Always has been, always will be.\"

  4. #4
    Ok this is untested - typed of top of my head, and doesn't do any form validation. But if you have a php enabled server it should work.

    Have commented most of it so should be easy to follow/adapt

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Contact Form</title>
    </head>
    
    <body>
    
    <?php
    
    /*----------------------------------------------
    / Get Details from Form
    / --------------------------------------------*/
    $name = $_POST['name'];
    $email = $_POST['email'];
    $type = $_POST['type'];
    $comment = $_POST['comment'];
    
    /*----------------------------------------------
    / Set Email Header Info
    / --------------------------------------------*/
    $headers = "MIME-Version: 1.0 \r\n";
    $headers .= "Content-type: text/html; ";
    $headers .= "charset=iso-8859-1\r\n";
    $headers .= "From: your@emailaddy.com\r\n"; //address email will appear from
    
    /*----------------------------------------------
    / Other Info to send
    / --------------------------------------------*/
    $date = date("d/m/y H:i");
    $userip =   $_SERVER['REMOTE_ADDR'];
    $to_email = "your@emailaddress.com"; //change this to your email
    $ref = $name . "rand(0, 3000)";
    
    /*----------------------------------------------
    / Start Main Script
    / --------------------------------------------*/
    
    //If all required fields are complete start process of sending email
    if($name && $email && $type && $comment)
    	{
    	//set up message to send to website owner
    	$msg = "<strong>You have a new email from $name [ $email ]</strong>\n<br />";
    	$msg .= "Sent on $date from ip : $userip\n<br />";
    	$msg .= "Type of email : $type\n<br />";
    	$msg .= $comment
    	$msg .= "\n<br />Thanks Whoever";
    	
    	//send the email
    	mail($to_email,"New Email Msg, Ref : $ref","$message",$headers);
    	
    	$ty_msg = "<br />Thank you, your email has been sent\n<br />";
    	$ty_msg .= "Your Refrence : $ref<br />\n<br />\n";
    	
    	//thats it
    	}
    ?>
    
    <!-- Show the Thank you message (if $ty_msg is empty nothing wil be printed) -->
    <?php echo $ty_msg; ?>
    
    <!-- Start Form -->
    <!-- The action="php" bit means it will always fill it with current page name -->
    <form name="form1" id="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    	
    	<!-- For all those people gasping at use of tables....read your w3c acceptable use. Tables should be used
    	     for the display and entry of tabular data (ie forms) -->
      <table width="100%"  border="0" cellspacing="0" cellpadding="3">
        <tr>
          <td width="10%">Name : </td>
          <td width="90%"><input name="name" type="text" id="name" value="<?php echo $name; ?>" /></td>
        </tr>
        <tr>
          <td>Email : </td>
          <td><input name="email" type="text" id="email" value="<?php echo $email; ?>" /></td>
        </tr>
        <tr>
          <td>Type : </td>
          <td>
    	  	<!-- You can easily change these Option Values -->
    		<select name="select">
            <option value="General" selected="selected">General</option>
            <option value="Question">Question</option>
            <option value="Order">Order</option>
            <option value="Misc">Misc</option>
          </select></td>
        </tr>
        <tr>
          <td valign="top" nowrap>Message : </td>
          <td><textarea name="comment" id="comment"><?php echo $comment; ?></textarea></td>
        </tr>
        <tr>
          <td></td>
          <td>
    	  <input type="submit" name="Submit" value="Send" />
          <input type="reset" name="Reset" value="Reset" /></td>
        </tr>
      </table>
    </form>
    </body>
    </html>
    ta

    v_Ln

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •