123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- session_start();
-
-
- if (isset($_POST['register'])){
- $db = new SQLite3 ("db.sqlite");
- $username = $_POST['username'];
- $password = $_POST['password_1'];
- $sql = "INSERT INTO users (username, password) VALUES ($username, $password)";
-
- //$stmt->prepare($sql);
- $db->exec($sql);
-
- echo "You are registered";
-
-
- }
- ?>
-
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>Document</title>
- </head>
- <body>
- <header>
- <h2>Register</h2>
- </header>
-
- <form method="POST" action="index.php">
- <div class="input-group">
- <label>Username</label>
- <input type="text" name="username">
- </div>
- <div class="input-group">
- <label>Email</label>
- <input type="text" name="email">
- </div>
- <div class="input-group">
- <label>Password</label>
- <input type="password" name="password_1">
- </div>
- <div class="input-group">
- <label>Confirm Password</label>
- <input type="password" name="password_2">
- </div>
- <div class="input-group">
- <button type="submit" name="register" class="btn">Register</button>
- </div>
- <p>
- Already signed up? <a href="login.php">Sign in</a>
- </p>
- </form>
-
-
-
-
-
-
-
-
-
- </body>
- </html>
|