Commit c0b31b0cd739260ca543b49eee5e26119c862403
1 parent
c5f5d11e
submit
Showing
4 changed files
with
52 additions
and
15 deletions
Show diff stats
blocks/footer_endhtml.php
... | ... | @@ -202,7 +202,7 @@ _________________________________________________________ --> |
202 | 202 | <script src="/js/start-swipe.js"></script> |
203 | 203 | <!-- owl carousel --> |
204 | 204 | <script src="js/owl.carousel.min.js"></script> |
205 | -<script src="/js/submit.js"></script> | |
205 | + <script src="/js/submit.js"></script> | |
206 | 206 | |
207 | 207 | </body> |
208 | 208 | </html> |
209 | 209 | \ No newline at end of file | ... | ... |
blocks/modal.php
... | ... | @@ -60,36 +60,36 @@ |
60 | 60 | <label>Выберите страницы</label> |
61 | 61 | <div class="style input-wr"> |
62 | 62 | <!--<div class="style radio_custom"> |
63 | - <input type="checkbox" id="type_pg1" name="page" value="главная"> | |
63 | + <input type="checkbox" id="type_pg1" name="page[]" value="главная"> | |
64 | 64 | <label for="type_pg1">главная</label> |
65 | 65 | </div>--> |
66 | 66 | <div class="style radio_custom"> |
67 | - <input type="checkbox" id="type_pg2" name="page" value="блог"> | |
67 | + <input type="checkbox" id="type_pg2" name="page[]" value="блог"> | |
68 | 68 | <label for="type_pg2">блог</label> |
69 | 69 | </div> |
70 | 70 | <div class="style radio_custom"> |
71 | - <input type="checkbox" id="type_pg3" name="page" value="портфолио"> | |
71 | + <input type="checkbox" id="type_pg3" name="page[]" value="портфолио"> | |
72 | 72 | <label for="type_pg3">портфолио</label> |
73 | 73 | </div> |
74 | 74 | <div class="style radio_custom"> |
75 | - <input type="checkbox" id="type_pg4" name="page" value="текстовая"> | |
75 | + <input type="checkbox" id="type_pg4" name="page[]" value="текстовая"> | |
76 | 76 | <label for="type_pg4">текстовая</label> |
77 | 77 | </div> |
78 | 78 | <div class="style radio_custom"> |
79 | - <input type="checkbox" id="type_pg5" name="page" value="галерея"> | |
79 | + <input type="checkbox" id="type_pg5" name="page[]" value="галерея"> | |
80 | 80 | <label for="type_pg5">галерея</label> |
81 | 81 | </div> |
82 | 82 | <div class="style radio_custom"> |
83 | - <input type="checkbox" id="type_pg6" name="page" value="прайс"> | |
84 | - <label for="type_pg5">прайс</label> | |
83 | + <input type="checkbox" id="type_pg6" name="page[]" value="прайс"> | |
84 | + <label for="type_pg6">прайс</label> | |
85 | 85 | </div> |
86 | 86 | <div class="style radio_custom"> |
87 | - <input type="checkbox" id="type_pg7" name="page" value="команда"> | |
88 | - <label for="type_pg5">команда</label> | |
87 | + <input type="checkbox" id="type_pg7" name="page[]" value="команда"> | |
88 | + <label for="type_pg7">команда</label> | |
89 | 89 | </div> |
90 | 90 | <!--<div class="style radio_custom"> |
91 | - <input type="checkbox" id="type_pg8" name="page" value="контакты"> | |
92 | - <label for="type_pg5">контакты</label> | |
91 | + <input type="checkbox" id="type_pg8" name="page[]" value="контакты"> | |
92 | + <label for="type_pg8">контакты</label> | |
93 | 93 | </div>--> |
94 | 94 | </div> |
95 | 95 | </div> | ... | ... |
js/submit.js
... | ... | @@ -16,11 +16,11 @@ $( |
16 | 16 | if (validate(dataArray)) { |
17 | 17 | $.ajax( |
18 | 18 | { |
19 | - url: 'http://artbox.net.ua/en/feedback', | |
19 | + url: 'submit.php', | |
20 | 20 | type: "POST", |
21 | 21 | data: dataArray, |
22 | 22 | success: function(data) { |
23 | - if (data.status) { | |
23 | + //if (data.status) { | |
24 | 24 | form.reset(); |
25 | 25 | var pos = ($(window) |
26 | 26 | .scrollTop() + 30 + 50); |
... | ... | @@ -43,7 +43,7 @@ $( |
43 | 43 | top: pos |
44 | 44 | }, 200 |
45 | 45 | ); |
46 | - } | |
46 | + //} | |
47 | 47 | } |
48 | 48 | } |
49 | 49 | ); | ... | ... |
1 | +<?php | |
2 | + header('Content-Type: text/plain'); | |
3 | + if(isset($_POST)){ | |
4 | + if(isset($_POST['name'])) $name = $_POST['name']; | |
5 | + if(isset($_POST['email'])) $email = $_POST['email']; | |
6 | + if(isset($_POST['phone'])) $phone = $_POST['phone']; | |
7 | + if(isset($_POST['message'])) $message = $_POST['message']; | |
8 | + | |
9 | + if(isset($_POST['site'])){ | |
10 | + $site = 'Выбранный сайт: '.$_POST['site'].'.'; | |
11 | + } | |
12 | + if(isset($_POST['page'])){ | |
13 | + $page = 'Выбранные страницы:'; | |
14 | + foreach($_POST['page'] as $pages){ | |
15 | + $page .=', '.$pages; | |
16 | + } | |
17 | + $page .= '.'; | |
18 | + $page = str_replace(":, ",": ",$page); | |
19 | + } | |
20 | + | |
21 | + $message .= "\r\n\r\n".$site."\r\n".$page; | |
22 | + | |
23 | + $url = "http://artbox.net.ua/en/feedback"; | |
24 | + $params = array( | |
25 | + 'name' => $name, | |
26 | + 'email' => $email, | |
27 | + 'phone' => $phone, | |
28 | + 'message' => $message | |
29 | + ); | |
30 | + $result = file_get_contents($url, false, stream_context_create(array( | |
31 | + 'http' => array( | |
32 | + 'method' => 'POST', | |
33 | + 'header' => 'Content-type: application/x-www-form-urlencoded', | |
34 | + 'content' => http_build_query($params) | |
35 | + ) | |
36 | + ))); | |
37 | + } | |
0 | 38 | \ No newline at end of file | ... | ... |