-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
$action=$_REQUEST['action']; | ||
if ($action=="") /* display the contact form */ | ||
{ | ||
?> | ||
<form action="" method="POST" enctype="multipart/form-data"> | ||
<input type="hidden" name="action" value="submit"> | ||
Your name:<br> | ||
<input name="name" type="text" value="" size="30"/><br> | ||
Your email:<br> | ||
<input name="email" type="text" value="" size="30"/><br> | ||
Your message:<br> | ||
<textarea name="message" rows="7" cols="30"></textarea><br> | ||
<input type="submit" value="Send email"/> | ||
</form> | ||
<?php | ||
} | ||
else /* send the submitted data */ | ||
{ | ||
$name=$_REQUEST['name']; | ||
$email=$_REQUEST['email']; | ||
$message=$_REQUEST['message']; | ||
if (($name=="")||($email=="")||($message=="")) | ||
{ | ||
echo "All fields are required, please fill <a href=\"\">the form</a> again."; | ||
} | ||
else{ | ||
$from="From: $name<$email>\r\nReturn-path: $email"; | ||
$subject="Message sent using your contact form"; | ||
mail("[email protected]", $subject, $message, $from); | ||
echo "Email sent!"; | ||
} | ||
} | ||
?> |