diff options
author | alexvitkov <44268717+alexvitkov@users.noreply.github.com> | 2021-01-29 12:52:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-29 12:52:06 +0200 |
commit | 33e533d28dbf9ad7bfc7ad9af467e5efe25ae8a0 (patch) | |
tree | 7b748d2b87ab018d7ff451b4111a1b88eeb58416 /php/login.php | |
parent | ceedd596c9f39f53555fd0746a42d6b85cd49b6c (diff) | |
parent | 472e170f408e3d8d1db2eb066d445153aad55d73 (diff) | |
download | fileup-33e533d28dbf9ad7bfc7ad9af467e5efe25ae8a0.tar.gz |
Merge pull request #1 from GTSimeonov/master
rararrararararraar
Diffstat (limited to 'php/login.php')
-rw-r--r-- | php/login.php | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/php/login.php b/php/login.php new file mode 100644 index 0000000..e6d44dc --- /dev/null +++ b/php/login.php @@ -0,0 +1,25 @@ +<?php +require_once "user.php"; +require_once "database.php"; +require_once "misc.php"; + +$username=$_POST["username"]; +$password=$_POST["password"]; +/*server side verification*/ +if(gettype($username)!="string" || gettype($password)!="string") +{ + die("You didn't specify the pass or the username"); +} + +$database=new Database(); +$user=$database->authenticate($username,$password); +if(!$user) +{ + die("Password or username is incorrect"); +} + +echo "Username: {$user->username}\n"; +echo "Email: {$user->email_address}"; + + +?> |