Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- register.php:
- <?php
- require_once 'connect.php';
- if(!empty($_POST)) {
- if(isset($_POST['username'], $_POST['password'], $_POST['desc'])) {
- $username = $_POST['username'];
- $password = $_POST['password'];
- if(!empty($username) && !empty($password)) {
- $insert = $db->prepare("INSERT INTO 'user' ('name', 'pass') VALUES (?, ?)");
- $insert->bind_param('ss', $username, $password);
- }
- }
- }
- ?>
- <html>
- <head>
- <?php
- require_once 'style.php';
- ?>
- <title>si | Registering an Account</title>
- </head>
- <body>
- <?php
- require_once 'header.php';
- ?>
- <div id="page">
- <h2>Register an Account on Si</h2>
- <form action="" method="post">
- <input type="text" name="username" placeholder="Username" autocomplete="off">
- <input type="password" name="password" placeholder="Password" autocomplete="off">
- <button>Register</button>
- </form>
- </div>
- </body>
- </html>
- connect.php:
- <?php
- $db = new mysqli('127.0.0.1', 'root', '');
- if($db->connect_errno) {
- echo "<p id='gotem'>Something has gone wrong.Tell J to fix it.</p>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement