diff --git a/login/dangky.php b/login/dangky.php new file mode 100644 index 0000000..c2f66af --- /dev/null +++ b/login/dangky.php @@ -0,0 +1,34 @@ + 0 ){ +// echo "true"; + return true; + } +// echo "false"; + return false; + } + if( isset( $_POST['username'] ) and isset( $_POST['password'] ) ){ + $check = checkUser( $_POST['username'] ); + $username = $_POST['username']; + $password = $_POST['password']; + if( $check == true ){ + header("location:index.php"); + } else{ + if( $password != "" ){ + $password = md5( $password ); + $sql = "insert into nguoidung set email = '$username', pass = '$password'"; + mysqli_query( $conn, $sql ); + header("location:../signup/"); + } else { + header("location:index.php"); + } + + } + } else { + header("location:index.php"); + } +?> \ No newline at end of file diff --git a/login/index.php b/login/index.php index e9b3f90..80fd031 100644 --- a/login/index.php +++ b/login/index.php @@ -56,7 +56,7 @@