1
+ <!DOCTYPE html>
2
+ <html lang="ru">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>Сокольская Е.К.</title>
8
+
9
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"
10
+ integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
11
+ <link rel=”stylesheet” href=”https://cdn.jsdelivr.net/npm/bootstrap-icons@1.5.0/font/bootstrap-icons.css” />
12
+ <link rel="stylesheet" href="css/style.css">
13
+ </head>
14
+
15
+ <body>
16
+ <div class="cpntainer">
17
+ <div class="row">
18
+ <div class="col-12">
19
+ <h1>Регистрация</h1>
20
+ </div>
21
+ </div>
22
+ <div class="row">
23
+ <div class="col-12">
24
+ <from method="POST" action="registration.php">
25
+ <div class="row form_reg"><input class="form" type="email" name="email" placeholder="Email"></div>
26
+ <div class="row form_reg"><input class="form" type="text" name="login" placeholder="Login"></div>
27
+ <div class="row form_reg"><input class="form" type="password" name="password" placeholder="Password"></div>
28
+ <button type="submit" class="btn_red btn_red" name="submit">Продолжить</button>
29
+ </form>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </body>
34
+ </html>
35
+
36
+ <?php
37
+ require_once ('bd.php ' );
38
+ $ link = mysqli_connect ('127.0.0.1 ' , 'root ' , '1 ' , 'name_db ' );
39
+
40
+ if (isset ($ _POST ['submit ' ])) {
41
+ $ email = $ _POST ['email ' ];
42
+ $ username = $ _POST ['username ' ];
43
+ $ password = $ _POST ['password ' ];
44
+
45
+ if (!$ email || !$ username || !$ password ) die ('Пожалуйста введите все значения! ' );
46
+
47
+ $ sql = "INSERT INTO users (email, username, password) VALUES (' $ email', ' $ username', ' $ password') " ;
48
+
49
+ if (!mysqli_query ($ link , $ sql )) {
50
+ echo "Не удалось добавить пользователя " ;
51
+ }
52
+ }
53
+ ?>
0 commit comments