From 5b9069e5d3f77f0148e1c867a14f9e1d44c229d4 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 17 Feb 2014 20:32:33 +0100 Subject: setup --- www/invite.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'www/invite.php') diff --git a/www/invite.php b/www/invite.php index f77e6f6..471e88c 100644 --- a/www/invite.php +++ b/www/invite.php @@ -17,7 +17,7 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') { if($invite > 0){ -/*Generates the invite key*/ +/*Generates the invite key => [-_0-9a-zA-Z]{11}*/ $key_array = array("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "_", "-", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" ); @@ -39,14 +39,12 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') { echo "ID: '$id', KEY: '$key', SAFE_EMAIL: '$safe_email'"; -// $db->exec("INSERT INT0 user (id, name, senpai, key, status, email) VALUES (NULL, '$id', '$key', 0, '$safe_email');"); -// $db->exec("UPDATE user SET invites='$invite' WHERE id='$id';"); if($db->exec(" BEGIN TRANSACTION; INSERT INTO user (id, name, senpai, key, status, email) VALUES (NULL, NULL, '$id', '$key', 0, '$safe_email'); UPDATE user SET invites='$invite' WHERE id='$id'; - COMMIT; - ")){ + COMMIT;") + ){ header("Refresh: 0; /invite?reason=success"); } else { header("Refresh: 0; /invite?reason=database"); @@ -56,6 +54,9 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') { header("Refresh: 0; /invite?reason=invites"); } } else { + +/*Prints the formular if requested with GET*/ + foreach ($_GET as $name => $value) { echo 'Name: ' . $name . ' Value: ' . $value . '
'; } @@ -67,5 +68,5 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') { "; - echo "ENDE"; + echo "END"; } -- cgit v1.2.3