PHP Code:
<?php if(isset($_POST['first'])) {
$message = $_POST['first'] . ' ' . $_POST['last'] . ' (' . $_POST['email'] . ') has just submitted your form.\n'
. 'Telephone: ' . $_POST['tel'] . '\n'
. 'Company: ' . $_POST['company'] . '\n';
mail("you@yourdomain.com", "Form submission", $message, "From: " . $_POST['email'] . "\r\n");
?>
<html>
<!-- Thank-you page goes here, in plain HTML -->
</html>
<?php
die();
}
?>
<html>
<head>
<title></title>
</head>
<body>
<form action="<?php echo($PHP_SELF); ?>" method="post">
Email: <input type="text" name="email"><br>
First name: <input type="text" name="first"><br>
Last name: <input type="text" name="last"><br>
Company name: <input type="text" name="company"><br>
<!-- You get the idea... -->
<input type="submit" value="Post">
</form>
</body>
</html>
Untested. Note that PHP may need some extra setup to get mail working.
Bookmarks