diff options
| author | root | 2014-02-17 20:32:33 +0100 |
|---|---|---|
| committer | root | 2014-02-17 20:32:33 +0100 |
| commit | 5b9069e5d3f77f0148e1c867a14f9e1d44c229d4 (patch) | |
| tree | 91d1095651d1ba0f308c7f3da7287cd7b03d8752 /www/invite.php | |
| parent | 90719f4deb17c8d89d74a7b9872764c1df081f6d (diff) | |
| download | files.iamfabulous.de-5b9069e5d3f77f0148e1c867a14f9e1d44c229d4.tar.gz | |
setup
Diffstat (limited to 'www/invite.php')
| -rw-r--r-- | www/invite.php | 13 |
1 files changed, 7 insertions, 6 deletions
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 . '<br />'; } @@ -67,5 +68,5 @@ if($_SERVER['REQUEST_METHOD'] == 'POST') { <input type='submit' name='submit' value='invite'> </form>"; - echo "ENDE"; + echo "END"; } |
