aboutsummaryrefslogtreecommitdiffstats
path: root/register.php
diff options
context:
space:
mode:
authoradam <adam@>2021-01-28 18:16:41 +0200
committeradam <adam@>2021-01-28 18:16:41 +0200
commit9cab0d0ed64f4e5289a0c979cae10a92508c391b (patch)
tree49fafe0e0067b7aa394a08556bda611bfdfe4c58 /register.php
parentceedd596c9f39f53555fd0746a42d6b85cd49b6c (diff)
downloadfileup-9cab0d0ed64f4e5289a0c979cae10a92508c391b.tar.gz
initial registering stuff
Diffstat (limited to 'register.php')
-rw-r--r--register.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/register.php b/register.php
new file mode 100644
index 0000000..7d6c03e
--- /dev/null
+++ b/register.php
@@ -0,0 +1,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";
+}
+
+?>