diff options
author | Julien Sere <jsere> | 2011-01-22 13:53:33 +0000 |
---|---|---|
committer | Julien Sere <jsere> | 2011-01-22 13:53:33 +0000 |
commit | 738943804f2e4005e1948ed19e0d02e4cd1df431 (patch) | |
tree | 19a9b074ebe4dfd32e4f9a5d81b45c70845b016f /app/v1_php/api/login/index.php | |
parent | 12f6cc3a6f90a67c1d922dd3d46a368b1066dee1 (diff) | |
download | 2011-usi-738943804f2e4005e1948ed19e0d02e4cd1df431.tar.gz 2011-usi-738943804f2e4005e1948ed19e0d02e4cd1df431.tar.bz2 2011-usi-738943804f2e4005e1948ed19e0d02e4cd1df431.zip |
On est bloqué à cause du long-polling... Pas de syncrho en php sous Windows
git-svn-id: file:///var/svn/2011-usi/trunk@9 db941bf7-0cb3-4dda-9634-87faf64f93a7
Diffstat (limited to 'app/v1_php/api/login/index.php')
-rw-r--r-- | app/v1_php/api/login/index.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/v1_php/api/login/index.php b/app/v1_php/api/login/index.php new file mode 100644 index 0000000..6cd1d77 --- /dev/null +++ b/app/v1_php/api/login/index.php @@ -0,0 +1,23 @@ +<?php + +/* +Table User +*/ + +require_once("../mysql_connect.inc.php"); + +$mail=mysql_real_escape_string($_POST['mail']); +$password=mysql_real_escape_string($_POST['password']); + +$req="SELECT 1 FROM User WHERE mail='$mail' AND password='$password' LIMIT 1"; +$res=mysql_query($req); + +if ( mysql_num_rows($res) !== 1 ) { + header("erreur", true, 400); + exit(); +} + +header("OK : CREATED", true, 201); +setcookie("session_key", rand(0, 1024*1024*1024*2-1)); //TODO unicité + +?> |