mirror of
https://github.com/dawidolko/Website-Templates.git
synced 2026-02-04 09:30:05 +00:00
Website templates
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
$EmailFrom = "admin@yoursite.com";
|
||||
$EmailTo = "your@yoursite.com";
|
||||
$Subject = "Message from your site";
|
||||
$Name = Trim(stripslashes($_POST['Name']));
|
||||
$Email = Trim(stripslashes($_POST['Email']));
|
||||
$Message = Trim(stripslashes($_POST['Message']));
|
||||
|
||||
// validation
|
||||
$validationOK=true;
|
||||
if (!$validationOK) {
|
||||
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
|
||||
exit;
|
||||
}
|
||||
|
||||
// prepare email body text
|
||||
$Body = "";
|
||||
$Body .= "Name: ";
|
||||
$Body .= $Name;
|
||||
$Body .= "\n";
|
||||
$Body .= "Email: ";
|
||||
$Body .= $Email;
|
||||
$Body .= "\n";
|
||||
$Body .= "Message: ";
|
||||
$Body .= $Message;
|
||||
$Body .= "\n";
|
||||
|
||||
// send email
|
||||
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
|
||||
|
||||
// redirect to success page
|
||||
if ($success){
|
||||
print "<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.php\">";
|
||||
}
|
||||
else{
|
||||
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user