Return to Snippet

Revision: 18986
at October 13, 2009 20:17 by brandonio21


Initial Code
PART 1
--------------------------------------------------
<table width="60%" border="0" align="center" cellpadding="6" cellspacing="2">
          <tr>
            <td><div align="right">
                <label for="textfield">Name:</label>
            </div></td>
            <td><div align="left">
                <input name="name" type="text" id="Name" size="45" maxlength="100" />
            </div></td>
          </tr>
          <tr>
            <td><div align="right">
                <label for="label">Email:</label>
            </div></td>
            <td><div align="left">
                <label for="label"></label>
                <input name="email" type="text" id="Email" size="45" maxlength="100" />
            </div></td>
          </tr>
          <tr>
            <td><div align="right">
                <label for="label2">Message:</label>
            </div></td>
            <td><div align="left">
              <textarea name="message" cols="45" rows="5" id="Message"></textarea>
            </div></td>
          </tr>
          <tr>
            <td><div align="right">
                <label>
                <input name="clear" type="reset" id="clear" value="Clear All" />
                </label>
            </div></td>
            <td><div align="left">
                <label for="Submit"></label>
                <input name="send" type="submit" id="send" onclick="MM_validateForm('Name','','R');MM_validateForm('Email','','RisEmail');MM_validateForm('Message','','R');return document.MM_returnValue" value="Send!" />
            </div></td>
          </tr>
        </table>






PART 2
---------------------------------------------------------
<?php

//setting variables
	$emailSubject = 'Contacted!';
	$webMaster = 'YOUREMAIL!';	
//gathering data variables

	$email = $_POST['email'];
	$name = $_POST['name'];
	$message = $_POST['message'];

	$body = <<<EOD
<br><hr><br>
Email: $email <br>
Name: $name <br>
Message: $message <br>
 <br>
EOD;

	$headers = "From: $email
";
	$headers .= "Content-type: text/html
";
	$success = mail($webMaster, $emailSubject, $body, $headers);
	
//displaying results as HTML


	$results = <<<EOD
<html>
<head>

</head>
<body>
<hr/>
<p><a href="index.html">Go Back</a></p>
</body>
<html>
EOD;
echo "$results";
?>

Initial URL

                                

Initial Description

                                

Initial Title
HTML CONTACT FORM PROCESS

Initial Tags

                                

Initial Language
PHP