Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'db_connect.php';
- error_reporting( E_ALL );
- ini_set( 'display_errors', 1 );
- var_dump($_POST);
- if (isset($_POST['submit'])){
- if (isset($_POST['FullName']) and isset($_POST['Username']) and isset($_POST['Password']) and isset($_POST['PhoneNumber']) and isset($_POST['Email'])){
- $fullname = mysqli_real_escape_string($connection, $_POST['FullName']);
- $username = mysqli_real_escape_string($connection, $_POST['Username']);
- $password = mysqli_real_escape_string($connection, $_POST['Password']);
- $phonenumber = mysqli_real_escape_string($connection, $_POST['PhoneNumber']);
- $email = mysqli_real_escape_string($connection, $_POST['Email']);
- $hashpassword = password_hash($password,PASSWORD_DEFAULT);
- $query = "INSERT INTO `users` (FullName,Username,Password,PhoneNumber,Email) VALUES ('$fullname','$username','$hashpassword','$phonenumber','$email')";
- $result = mysqli_query($connection, $query) or die(mysqli_error($connection));
- $existedAcc = "SELECT * FROM `users` WHERE Email = '$email'";
- $resultcheck = mysqli_query($connection, $existedAcc);
- $count = mysqli_num_rows($resultcheck);
- if($count == 1){
- window.location.href='https://janmticketing.000webhostapp.com/Register/Register.php';
- // echo "Account is already exist! Please try a different email.";
- }
- else{
- if($resultcheck){
- window.location.href='https://janmticketing.000webhostapp.com/index.php';
- // echo "Successfully registered";
- }
- else{
- echo" error something happened";
- }
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement