aboutsummaryrefslogtreecommitdiffstats
path: root/register.php
blob: 7d6c03ea64d51305b4738a17fb24d9b90c87dd76 (plain)
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
<?php
require_once "php/database.php";
require_once "php/misc.php";

$username=$_POST["username"];
$password=$_POST["password"];
$password2=$_POST["password2"];
$email=$_POST["email"];

/*check if we are given shady credentials*/
if(!validate_credentials($username,$email,$password,$password2))
{
	error_log("Invalid registration that has probbably bypassed client side verification. This could be an attack!");
	die();
}
$database= new Database;

if($database->register_user($username,$password,$email))
{
	echo "registered";
}else
{
	echo "didn't register";
}

?>