-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup.php
More file actions
41 lines (26 loc) · 881 Bytes
/
Copy pathsignup.php
File metadata and controls
41 lines (26 loc) · 881 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
38
39
40
41
<html>
<body>
<?php
$name = $_POST["name"];
$username = $_POST["username"];
$password = $_POST["password"];
$password2 = $_POST["password-2"];
$email = $_POST["email"];
$url = $_POST["url"];
$image = $_POST["image"];
if($password == $password2) {
$sql = "INSERT INTO person(email, username, password, name, image) VALUES('". $email ."', '" . $username . "', '" . $password . "', '" . $name ."', 'img/" . $image . "');";
$password = "INSERT PASSWORD HERE";
$conn=pg_connect("host=localhost port=5432 dbname=crowdFunding user=postgres password='$password'") or die('Could not connect: ' . pg_last_error());
$result = pg_query($conn, $sql);
var_dump($result);
pg_close($conn);
session_start();
$_SESSION['username'] = $username;
$_SESSION['name'] = $name;
$_SESSION['email'] = $email;
header("Location: " . $url);
}
?>
</body>
</html>