-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreg.php
More file actions
102 lines (90 loc) · 3.28 KB
/
reg.php
File metadata and controls
102 lines (90 loc) · 3.28 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<html>
<head>
<meta charset="utf-8">
<title>yurets</title>
<link rel="stylesheet" type="text/css" href="PP.css"/>
<link rel="shortcut icon" type="image/x-icon" href="PP.css"/>
<meta name="keywords" content="TV,chanel"/>
</head>
<body>
<div id="page-wrap">
<header>
<a href="сайт.html" title="на главную" id="logo">Test site</a>
<span class="contact"><a href="about.html"title="Информация о нас!">О нас!</a></span>
<input type="Serch" class="field" placeholder="Давай помогу найти"/>
<span class="right"><span class="contact">
<a href="reg.html"title="Зарегестрируйтесь!">Регистрация!</a></span></span>
<span class="right"><span class="contact">
<a href="auth.html"title="войти!">Вход!</a></span></span>
</header>
<div class="clear"><br/></div>
<center>
<div id="menu">Разделы<hr/></div>
<div id="menuHrefs">
<a href="about.html">О нас </a>
<a href="feedback.php">Обратная связь </a>
<a href="auth.html">Вход </a>
<a href="reg.html">регистрация </a>
</div>
<?php
require "db.php";
$data = $_POST;
if(isset($data['do_feedback']) )
{
// ---
$errors = array();
if( trim($data['name']) == '')
{
$errors[]= 'Введите Имя!';
}
if( trim($data['email']) == '')
{
$errors[]= 'Введите EMAIL!';
}
if( trim($data['tel']) == '')
{
$errors[]= 'Введите телефон!';
}
if(empty($errors) )
{
$user = R::dispense('feedback');
$user->name = $data['name'];
$user->email = $data['email'];
$user->telephone = $data['tel'];
R::store($user);
} else
{
echo '<div >'.array_shift($errors).'</div><hr>';
}
}
?>
</center>
<form id="localStorageTest" method="POST" action="index.php" class="contact_form">
<p>
<label>Имя:</label>
<input class="stored" type="text" name="name" id="name" placeholder="Введите ваше имя" required />
</p>
<p>
<label>Email:</label>
<input type="email" name="email" id="email" class="stored" placeholder="Введите электронный адрес" required />
<span class="form_hint">Правильный формат "name@something.com"</span>
</p>
<p>
<label for="tel">Телефон:</label>
<input type="tel" name="tel" id="tel" class="stored" placeholder="Введите номер телефона" required pattern="380[0-9]{2}-[0-9]{3}-[0-9]{2}-[0-9]{2}" />
<span class="form_hint">Правильный формат "38095-(xxx)-(xx)-(xx)"</span>
</p>
<p>
<label>Текст сообщения:</label>
<textarea class="stored" name="message" id="message" cols="40" rows="6" required placeholder="Напишите что"></textarea>
</p>
<input name="bezspama" type="text" style="display:none" value="" />
<input name="do_feedback" type="submit" class="demo-button" value="Submit" />
</form>
</div>
<footer>
<span class="left"> Все права защищены © 2017</span>
<span class="right">социальные кнопки<img src=" " alt=" Facebook" title=" Facebook"</span>
</footer>
</body>
</html>