-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontact.php
43 lines (39 loc) · 1.4 KB
/
contact.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
if ($_GET['a']=="submit")
{
$name = substr($_POST['name'], 0, 30);
$phone = substr($_POST['phone'], 0, 15);
$email = substr($_POST['email'], 0, 45);
$message = wordwrap(substr($_POST['message'], 0, 1500));
if ($message == "")
{
print "<html><head><title>Contact</title>
<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" /></head><body><p>System error...</p></body></html>";
die();
}
if(mail("[email protected];[email protected]","Mail from MrEdAndTheHorses","From: $name\nPhone: $phone\nE-mail: $email\n\n\n$message")) {
print "<html><head><title>Contact</title><link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" /></head><body><span>Thanks!</span></body></html>";
} else {
print "<html><head><title>Contact</title><link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" /></head><body><span>System error...</span></body></html>";
}
die();
}
print '
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<title>MrEdAndTheHorses.com - Contact</title>
</head>
<body>
<form method="post" action="contact.php?a=submit">
<p>Name: <input type="text" name="name" /></p>
<p>Phone: <input type="text" name="phone" /></p>
<p>E-mail: <input type="text" name="email" /></p>
<p>Message:</p>
<p><textarea rows="8" cols="20" name="message"></textarea></p>
<p align=center><input type="submit" name="Submit" value="Send Message" /></p>
</form>
</body>
</html>';
die();
?>