Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Здесь проверяется существование переменных */
- if (isset($_POST['name'])) {$name = $_POST['name'];}
- if (isset($_POST['phone'])) {$phone = $_POST['phone'];}
- if (isset($_POST['ques'])) {$phone = $_POST['ques'];}
- /* Сюда впишите свою эл. почту */
- $address = "madest4815@gmail.com";
- /* А здесь прописывается текст сообщения, n - перенос строки */
- $mes = "Тема: Заказ обратного звонка!nТелефон: $phonenВопрос: $quesnИмя: $name ";
- /* А эта функция как раз занимается отправкой письма на указанный вами email */
- $sub='Заказ'; //сабж
- $email='Заказ <ОКНА ПВХ>'; // от кого
- $send = mail ($address,$sub,$mes,"Content-type:text/plain; charset = utf-8rnFrom:$email");
- ini_set('short_open_tag', 'On');
- header('Refresh: 3; URL=index.html');
- ?>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta http-equiv="refresh" content="3; url=index.htm">
- <title>С вами свяжутся</title>
- <meta name="generator">
- <style type="text/css">
- body
- {
- background: #22BFF7 url(img/zakaz.jpg) top -70% center no-repeat;
- }
- <script type="text/javascript">
- setTimeout('location.replace("/index.htm")', 3000);
- /*Изменить текущий адрес страницы через 3 секунды (3000 миллисекунд)*/
- </script>
- </head>
- </body>
- </html>
- $('.button').click(function() {
- var msg = $('#formx').serialize();
- $.ajax({
- type: 'POST',
- url: 'res.php',
- data: msg,
- success: function(data) {
- $('.results').html(data);
- },
- error: function(xhr, str){
- alert('Возникла ошибка: ' + xhr.responseCode);
- }
- });
- }
- $name ="";
- $phone ="";
- $ques ="";
- if (isset($_POST['name'])) {$name = $_POST['name']; }
- if (isset($_POST['phone'])) {$phone = $_POST['phone'];}
- if (isset($_POST['phone2'])) {$phone.= $_POST['phone2'];}
- if (isset($_POST['phone3'])) {$phone.= $_POST['phone3'];}
- if (isset($_POST['ques'])) {$ques = $_POST['ques']; }
- echo "name = ".$name."phone= ".$phone."ques= ".$ques;
Add Comment
Please, Sign In to add comment