Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <body>
- <form action="" method"post" class="form">
- <div class="form-group1">
- <label for="" >Username :</label>
- <input type="text" class="form-control" name="username" id="tb-username" placeholder="Username">
- </div>
- <div class="form-group2">
- <label for="" >Password :</label>
- <input type="password" class="form-control" name="password" id="tb-password" placeholder="Password">
- </div>
- <button type="submit" class="btn btn-primary" id="btn-submit" name="register">Submit</button>
- </form>
- <?php
- if(isset($_POST['register']))
- {
- if(isset($_POST['username'], $_POST['password']))
- {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $link = mysqli_connect("localhost", "root", " ", "vbproject");
- if(mysqli_connect_errno())
- {
- printf("Connect failed: %sn", mysqli_connect_errno());
- exit();
- }
- $sql = "INSERT INTO users (username, password)
- VALUES('$username', '$password')";
- mysqli_close($link);
- }
- }
- ?>
- </body>
Add Comment
Please, Sign In to add comment