Skip to content

Instantly share code, notes, and snippets.

@camh96
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save camh96/2cbffeaa79ab633fbe2b to your computer and use it in GitHub Desktop.
Save camh96/2cbffeaa79ab633fbe2b to your computer and use it in GitHub Desktop.
Contact Form - see index.html for the form input
<?php
include 'config.php';
error_reporting (E_ALL ^ E_NOTICE);
$post = (!empty($_POST)) ? true : false;
if($post)
{
$name = stripslashes($_POST['name']);
$email = trim($_POST['email']);
$message = stripslashes($_POST['message']);
$error = '';
if(!$error)
{
$mail = mail(WEBMASTER_EMAIL, $subject, $message,
"From: ".$name." <".$email.">\r\n"
."Reply-To: ".$email."\r\n"
."X-Mailer: PHP/" . phpversion());
if($mail)
{
header("Location: ../index.php?success#contact");
}
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment