aboutsummaryrefslogtreecommitdiffstats
path: root/php/register.php
diff options
context:
space:
mode:
authoradam <adam@>2021-01-29 03:26:28 +0200
committeradam <adam@>2021-01-29 03:26:28 +0200
commit472e170f408e3d8d1db2eb066d445153aad55d73 (patch)
tree7b748d2b87ab018d7ff451b4111a1b88eeb58416 /php/register.php
parent5d3d901d968db7eb3da9c038e6d823f7c75f1e10 (diff)
downloadfileup-472e170f408e3d8d1db2eb066d445153aad55d73.tar.gz
register and login looks ok
Diffstat (limited to 'php/register.php')
-rw-r--r--php/register.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/php/register.php b/php/register.php
new file mode 100644
index 0000000..b6b164c
--- /dev/null
+++ b/php/register.php
@@ -0,0 +1,27 @@
+<?php
+require_once "database.php";
+require_once "misc.php";
+require_once "configuration.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";
+}
+
+?>