Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require('connect.php');
- // If the values are posted, insert them into the database.
- if (isset($_POST['username']) && isset($_POST['password'])){
- $username = $_POST['username'];
- $email = $_POST['email'];
- $password = $_POST['password'];
- $confpassword = $_POST['confirm_password'];
- if ($_POST["password"] === $_POST["confirm_password"]) {
- echo 'Password Matched';
- }
- else {
- echo 'Password Match Failed';// failed :(
- }
- $hashPassword = password_hash($password,PASSWORD_BCRYPT);
- $query = "INSERT INTO `user` (username, password, email) VALUES ('$username', '$password', '$email')";
- $result = mysqli_query($connection, $query);
- if($result){
- $smsg = "User Created Successfully.";
- }else{
- $fmsg ="User Registration Failed";
- }
- }
- ?>
Add Comment
Please, Sign In to add comment