Skip to content

Instantly share code, notes, and snippets.

@redhoodie
Forked from camh96/contact.php
Created July 7, 2014 07:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save redhoodie/0a923bf8ca819fe11358 to your computer and use it in GitHub Desktop.
Save redhoodie/0a923bf8ca819fe11358 to your computer and use it in GitHub Desktop.
<?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']);
$subject = stripslashes($_POST['subject']);
$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