-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathregistration.php
52 lines (47 loc) · 1.84 KB
/
registration.php
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
42
43
44
45
46
47
48
49
50
51
52
<?php
$host="localhost";
$user="ayoub";
$passwd="secret";
$db="pi";
// Connect to server and select databse.
$dbconn = pg_connect("host=$host dbname=$db user=$user password=$passwd")
or die('Could not connect: ' . pg_last_error());
// username and password sent from form
$nickname = pg_escape_string(utf8_encode($_POST['usernamesignup']));
$password = pg_escape_string(utf8_encode($_POST['passwordsignup']));
$password_confirm = pg_escape_string(utf8_encode($_POST['passwordsignup_confirm']));
$email = pg_escape_string(utf8_encode($_POST['emailsignup']));
$query = "INSERT INTO suspended_user(suspended_email, nickname, passwd) VALUES ('$email', '$nickname', '$password')";
$result = pg_query($query) or die('Query failed: ' . pg_last_error());
//header("location:index.html");
?>
<html>
<head>
<title>Loading</title>
<link rel="stylesheet" type="text/css" href="css/demo.css" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript">
function sleep(milliseconds) {
var start = new Date().getTime();
for(var i = 0; i < 1e7; i++) {
if((new Date().getTime() - start) > milliseconds){
break;
}
}
}
</script>
</head>
<body>
<div class="container">
<header>
<h1> Registration completed successfully, <span> You need to wait until your account is activated </span> </h1>
</header>
<script type="text/javascript">
setTimeout('Redirect()',4000);
function Redirect() {
location.href = 'index.html';
}
</script>
</div>
</body>
</html>