-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreateaccount.php
More file actions
40 lines (40 loc) · 922 Bytes
/
createaccount.php
File metadata and controls
40 lines (40 loc) · 922 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
<html>
<body>
<?php
session_start();
if(!isset($_POST))
header("location: home.php");
$link= mysqli_connect("localhost","root","","vtwa");
if(!$link)
{
die("Database did not connect. ".mysqli_error($link));
}
$pwd=$_POST['pwd0'];
$username=$_POST['username0'];
$email=$_POST['email'];
if($username!='0')
{
$query="insert into users values('$username','$pwd','$email','0,0,0,0,0,0,0,0,0,0',0);";
//mysqli_query($link,$query);
//echo mysqli_error($link);
if(mysqli_query($link,$query))
{
echo "<script>alert('Account created');
window.location.replace('home.php');
</script>";
}
else
{
echo "<script>alert('Username/email is unavailable.');
window.location.replace('home.php');
</script>";
}
}
else{
echo "<script>alert('No one can have username 0');
window.location.replace('home.php');
</script>";
}
?>
</body>
</html>