Users can now see a list of their pastes

This commit is contained in:
pikami
2016-06-12 17:19:52 +00:00
parent df2eabccb0
commit 04a6be87a5
8 changed files with 1850 additions and 5 deletions

View File

@@ -55,8 +55,22 @@ if(isset($_GET["logout"])){
$user = $_POST["user"];
$pwd = $_POST["pwd"];
$hash = password_hash($pwd ,CRYPT_BLOWFISH);
//Register the user
//Does this user exist
include "config/config.php";
$stmt = $conn->prepare('SELECT * FROM users WHERE user=?');
$stmt->execute(array($user));
if($result = $stmt->fetch(PDO::FETCH_ASSOC)){
echo "<div class=\"container\"><h2>User allready exists!</h2></div>";
$conn = null;
die();
}
//Did the person enter a password
if($pwd==""){
echo "<div class=\"container\"><h2>You need a password to singup!</h2></div>";
$conn = null;
die();
}
//Register the user
$stmt = $conn->prepare("INSERT INTO users (user,password)
VALUES (:user, :pwd)");
$stmt->bindParam(':user', $user);