<?php
function h($text){
return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
}
function check($d, $message, $message2){
if (strlen($d) <= 0){
echo $message;
exit();
}
elseif (strlen($d) > 13){
echo $message2;
exit();
}
}
$name = h($_POST['name']);
$phone = h($_POST['phone']);
check($name, 'Вы не представились', 'Имя слишком длинное (до 13 символов');
check($phone, 'Вы не ввели номер', 'Номер слишком длинный (до 13 символов)');
if (!preg_match('/^\d+$/i', $phone)) {
echo 'В поле номера недопустимые символы (вводите только числа)';
exit();
}
$send_to = 'zalupa@ya.ru'; //Куда шлем
$sender = 'callback'; //От имени кого
$header = 'Обратный звонок'; //Заголовок письма
/* Формируем письмо */
$message = "Заказ обратного звонка,
Имя отправителя: $name
Номер телефона: $phone";
$from = "From: $sender";
mail($send_to, $header, $message, $from);
header('Location: site.ru');
?>
PD9waHAKZnVuY3Rpb24gaCgkdGV4dCl7CiAgICByZXR1cm4gaHRtbHNwZWNpYWxjaGFycygkdGV4dCwgRU5UX1FVT1RFUywgJ1VURi04Jyk7Cn0KZnVuY3Rpb24gY2hlY2soJGQsICRtZXNzYWdlLCAkbWVzc2FnZTIpewogICAgaWYgKHN0cmxlbigkZCkgPD0gMCl7CiAgICAgICAgZWNobyAkbWVzc2FnZTsKICAgICAgICBleGl0KCk7CiAgICB9CiAgICBlbHNlaWYgKHN0cmxlbigkZCkgPiAxMyl7CiAgICAgICAgICAgIGVjaG8gJG1lc3NhZ2UyOwogICAgICAgICAgICBleGl0KCk7CiAgICAgICAgfQp9CgokbmFtZSA9IGgoJF9QT1NUWyduYW1lJ10pOwokcGhvbmUgPSBoKCRfUE9TVFsncGhvbmUnXSk7CgpjaGVjaygkbmFtZSwgJ9CS0Ysg0L3QtSDQv9GA0LXQtNGB0YLQsNCy0LjQu9C40YHRjCcsICfQmNC80Y8g0YHQu9C40YjQutC+0Lwg0LTQu9C40L3QvdC+0LUgKNC00L4gMTMg0YHQuNC80LLQvtC70L7QsicpOwpjaGVjaygkcGhvbmUsICfQktGLINC90LUg0LLQstC10LvQuCDQvdC+0LzQtdGAJywgJ9Cd0L7QvNC10YAg0YHQu9C40YjQutC+0Lwg0LTQu9C40L3QvdGL0LkgKNC00L4gMTMg0YHQuNC80LLQvtC70L7QsiknKTsKCmlmICghcHJlZ19tYXRjaCgnL15cZCskL2knLCAkcGhvbmUpKSB7CiAgICBlY2hvICfQkiDQv9C+0LvQtSDQvdC+0LzQtdGA0LAg0L3QtdC00L7Qv9GD0YHRgtC40LzRi9C1INGB0LjQvNCy0L7Qu9GLICjQstCy0L7QtNC40YLQtSDRgtC+0LvRjNC60L4g0YfQuNGB0LvQsCknOwogICAgZXhpdCgpOwp9Cgokc2VuZF90byA9ICd6YWx1cGFAeWEucnUnOyAvL9Ca0YPQtNCwINGI0LvQtdC8CiRzZW5kZXIgPSAnY2FsbGJhY2snOyAvL9Ce0YIg0LjQvNC10L3QuCDQutC+0LPQvgokaGVhZGVyID0gJ9Ce0LHRgNCw0YLQvdGL0Lkg0LfQstC+0L3QvtC6JzsgLy/Ql9Cw0LPQvtC70L7QstC+0Log0L/QuNGB0YzQvNCwCgovKiDQpNC+0YDQvNC40YDRg9C10Lwg0L/QuNGB0YzQvNC+ICovCiRtZXNzYWdlID0gItCX0LDQutCw0Lcg0L7QsdGA0LDRgtC90L7Qs9C+INC30LLQvtC90LrQsCwK0JjQvNGPINC+0YLQv9GA0LDQstC40YLQtdC70Y86ICRuYW1lCtCd0L7QvNC10YAg0YLQtdC70LXRhNC+0L3QsDogJHBob25lIjsKCgokZnJvbSAgPSAiRnJvbTogJHNlbmRlciI7Cm1haWwoJHNlbmRfdG8sICRoZWFkZXIsICRtZXNzYWdlLCAkZnJvbSk7CmhlYWRlcignTG9jYXRpb246IHNpdGUucnUnKTsKCj8+
Main.java:1: error: class, interface, or enum expected
<?php
^
Main.java:1: error: class, interface, or enum expected
<?php
^
Main.java:1: error: class, interface, or enum expected
<?php
^
Main.java:3: error: unclosed character literal
return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
^
Main.java:3: error: unclosed character literal
return htmlspecialchars($text, ENT_QUOTES, 'UTF-8');
^
Main.java:4: error: class, interface, or enum expected
}
^
Main.java:8: error: class, interface, or enum expected
exit();
^
Main.java:9: error: class, interface, or enum expected
}
^
Main.java:12: error: class, interface, or enum expected
exit();
^
Main.java:13: error: class, interface, or enum expected
}
^
Main.java:16: error: unclosed character literal
$name = h($_POST['name']);
^
Main.java:16: error: unclosed character literal
$name = h($_POST['name']);
^
Main.java:17: error: class, interface, or enum expected
$phone = h($_POST['phone']);
^
Main.java:17: error: unclosed character literal
$phone = h($_POST['phone']);
^
Main.java:17: error: unclosed character literal
$phone = h($_POST['phone']);
^
Main.java:19: error: class, interface, or enum expected
check($name, '?? ?? ?????????????', '??? ??????? ??????? (?? 13 ????????');
^
Main.java:19: error: unclosed character literal
check($name, '?? ?? ?????????????', '??? ??????? ??????? (?? 13 ????????');
^
Main.java:19: error: unclosed character literal
check($name, '?? ?? ?????????????', '??? ??????? ??????? (?? 13 ????????');
^
Main.java:19: error: unclosed character literal
check($name, '?? ?? ?????????????', '??? ??????? ??????? (?? 13 ????????');
^
Main.java:19: error: unclosed character literal
check($name, '?? ?? ?????????????', '??? ??????? ??????? (?? 13 ????????');
^
Main.java:20: error: class, interface, or enum expected
check($phone, '?? ?? ????? ?????', '????? ??????? ??????? (?? 13 ????????)');
^
Main.java:20: error: unclosed character literal
check($phone, '?? ?? ????? ?????', '????? ??????? ??????? (?? 13 ????????)');
^
Main.java:20: error: unclosed character literal
check($phone, '?? ?? ????? ?????', '????? ??????? ??????? (?? 13 ????????)');
^
Main.java:20: error: unclosed character literal
check($phone, '?? ?? ????? ?????', '????? ??????? ??????? (?? 13 ????????)');
^
Main.java:20: error: unclosed character literal
check($phone, '?? ?? ????? ?????', '????? ??????? ??????? (?? 13 ????????)');
^
Main.java:22: error: class, interface, or enum expected
if (!preg_match('/^\d+$/i', $phone)) {
^
Main.java:22: error: unclosed character literal
if (!preg_match('/^\d+$/i', $phone)) {
^
Main.java:22: error: illegal character: '\'
if (!preg_match('/^\d+$/i', $phone)) {
^
Main.java:22: error: unclosed character literal
if (!preg_match('/^\d+$/i', $phone)) {
^
Main.java:23: error: unclosed character literal
echo '? ???? ?????? ???????????? ??????? (??????? ?????? ?????)';
^
Main.java:23: error: unclosed character literal
echo '? ???? ?????? ???????????? ??????? (??????? ?????? ?????)';
^
Main.java:25: error: class, interface, or enum expected
}
^
Main.java:27: error: unclosed character literal
$send_to = 'zalupa@ya.ru'; //???? ????
^
Main.java:27: error: unclosed character literal
$send_to = 'zalupa@ya.ru'; //???? ????
^
Main.java:28: error: class, interface, or enum expected
$sender = 'callback'; //?? ????? ????
^
Main.java:28: error: unclosed character literal
$sender = 'callback'; //?? ????? ????
^
Main.java:28: error: unclosed character literal
$sender = 'callback'; //?? ????? ????
^
Main.java:29: error: unclosed character literal
$header = '???????? ??????'; //????????? ??????
^
Main.java:29: error: unclosed character literal
$header = '???????? ??????'; //????????? ??????
^
Main.java:32: error: unclosed string literal
$message = "????? ????????? ??????,
^
Main.java:34: error: unclosed string literal
????? ????????: $phone";
^
Main.java:38: error: class, interface, or enum expected
mail($send_to, $header, $message, $from);
^
Main.java:39: error: class, interface, or enum expected
header('Location: site.ru');
^
Main.java:39: error: unclosed character literal
header('Location: site.ru');
^
Main.java:39: error: unclosed character literal
header('Location: site.ru');
^
Main.java:41: error: class, interface, or enum expected
?>
^
46 errors