-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
321 changed files
with
566 additions
and
82,210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
include "../../config.php"; | ||
function checkUser($username) { | ||
global $conn; | ||
$sql = "select email from nguoidung where email = '$username'"; | ||
$result = mysqli_query( $conn, $sql); | ||
if (mysqli_num_rows($result) > 0) { | ||
return true; | ||
} | ||
|
||
return false; | ||
} | ||
|
||
function echoJson($result) { | ||
echo json_encode(array("result" => $result)); | ||
} | ||
|
||
if (isset($_POST['user']) and isset($_POST['pass'])) { | ||
$check = checkUser($_POST['user']); | ||
$username = $_POST['user']; | ||
$password = $_POST['pass']; | ||
|
||
if($check == true) { | ||
echoJson(false); | ||
} else { | ||
$password = md5( $password ); | ||
$sql = "insert into nguoidung set email = '$username', pass = '$password'"; | ||
mysqli_query( $conn, $sql ); | ||
echoJson(true); | ||
} | ||
} | ||
else { | ||
echoJson(false); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<div class="modal fade" id="form-signup" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true"> | ||
<div class="modal-dialog modal-sm"> | ||
<div class="modal-content"> | ||
<form class="form-signup" role="form" data-toggle="validator"> | ||
<label for="inputEmail" class="sr-only">Email</label> | ||
<input type="email" id="inputEmail-up" class="form-control" placeholder="Email address" required autofocus> | ||
<label for="inputPassword-up" class="sr-only">Mật khẩu</label> | ||
<input type="password" data-minlength="6" id="inputPassword-up" class="form-control" placeholder="Password" required> | ||
<span class="help-block">Minimum of 6 characters</span> | ||
<input type="password" class="form-control" id="inputPasswordConfirm" data-match="#inputPassword-up" data-match-error="Whoops, these don't match" placeholder="Confirm" required> | ||
<button class="btn btn-lg btn-primary btn-block" type="submit" id="btn-signup-submit">Đăng ký</button> | ||
</form> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.