forked from aorti017/CS180-Project
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfbMakeUser.php
More file actions
37 lines (29 loc) · 941 Bytes
/
Copy pathfbMakeUser.php
File metadata and controls
37 lines (29 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<html>
<body>
<?php
include './database.php';
$uname = $_GET['username'];
$password = password_hash($_GET['password'], PASSWORD_DEFAULT);
$firstname = $_GET['firstname'];
$lastname = $_GET['lastname'];
$birthday = $_GET['birthday'];
$gender = $_GET['gender'];
$email = $_GET['email'];
$fbid = $_GET['fbid'];
$statement = "SELECT * FROM Users WHERE BINARY username='".$_GET['uname']."'";
$results = executeStatement($statement);
if(count($results)==0)
{}
else
{
header('Location: ./createFBUser.php?error=login');
}
$statement = "INSERT INTO Users (username, password, firstname, lastname, birthday, gender,email, fbid)VALUE('".$uname."', '".$password."', '".$firstname."', '".$lastname."', '".$birthday."', '".$gender."', '".$email."', '".$fbid."')";
executeStatement($statement);
setcookie('username', $uname, 0);
session_start();
$_SESSION["username"] = $uname;
header('Location: contacts.php');
?>
</body>
</html>