error_reporting false ignore_user_abort false mail_from reg farstyle n

 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
<?
error_reporting(false);
ignore_user_abort(false);
$mail_from="reg@farstyle.net";
$mail_to="your@adress.ru";
$thm="Tema";
$err = array();
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,9}$/",$_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(!preg_match("/^[a-zA-Z0-9]+$/",$_POST['text'])){
$err[] = "[~] Wrong info.";
}
if(count($err) == 0) {
$msg="Почта: ".$_POST['email'].".\r\nАся: ".$_POST['icq'].".\r\nДжаббер: ".$_POST['jabber'].".\r\nИнфо: ".$_POST['text'];
if(!mail($mail_to, $thm, $msg, "From: $mail_from")){
echo "Sorry email function not answer...try later...";
}else{
echo "Send ok.";
}
} else {
echo count($err);
foreach($err AS $error)
{
print $error."<br>";
}
}
?>