• Welcome to ForumKorner!
    Join today and become a part of the community.

PHP Contact Form Script

OliverE

Power member.
Reputation
0
PHP Contact Form Script

Code Snippet Links to: http://cybertechforums.com/thread-1943
Save as: contactSend.php
Edit $webMaster email address.

PHP:
<?php

$emailSubject = 'Contact Form Message';
$webMaster = '[email protected]';

$nameField = $_POST['name'];
$emailField = $_POST['email'];
$commentsField = $_POST['comments'];

header("Location: sent.html");

$body = <<<EOD
<br />
Name: $nameField <br />
Email: $emailField <br />
Comments: $commentsField <br />
<br />
EOD;

$headers = "From: $emailField\r\n";
$headers .= "Content-type: text/html\r\n";

$success = mail($webMaster, $emailSubject, $body, $headers);

?>

HTML Form
 
Top