error_reporting false ignore_user_abort false mail_from reg user ru ma

 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?
error_reporting(false);
ignore_user_abort(false);
$mail_from="reg@user.ru";
$mail_to="your@adress.ru";
$thm="Tema";
$err = array();
if ($_POST['boxcheck']=="agree") {
$err[] = "[~] Wrong chk.";
}
if ($_SERVER['HTTP_REFERER']=="http://sites.google.com/site/zdorovoemedia/"){ //address refferer
$err[] = "[~] Wrong addr.";
}
if (!preg_match("/^[0-9a-z_]+@[0-9a-z_^\.]+\.[a-z]{2,3}$/i", $_POST['email'])){
$err[] = "[~] Wrong email.";
}
if (!preg_match("/^[0-9a-z_]+@[0-9a-z_^\.]+\.[a-z]{2,3}$/i", $_POST['email'])){
$err[] = "[~] Wrong email.";
}
if(!preg_match("/^[0-9-]{5,11}$/",$_POST['icq']))
{
$err[] = "[~] Wrong icq.";
}
if (!preg_match("/^[0-9a-z_]+@[0-9a-z_^\.]+\.[a-z]{2,3}$/i", $_POST['jabber'])){
$err[] = "[~] Wrong jabber email.";
}
if(count($err) == 0) {
$msg="Почта: ".$_POST['email'].".\r\nАся: ".$_POST['icq'].".\r\nДжаббер: ".$_POST['jabber'].".\r\n";
if(!mail($mail_to, $thm, $msg, "From: $mail_from")){
echo "Sorry email function not answer...try later...";
}else{
echo "Send ok.";
}
} else {
foreach($err AS $error)
{
print $error."<br>";
}
}
?>