Faster Update, fixing bugs
[smail.git/.git] / mailbox / user.php
1 <?php
2 include '../api/server_info.php';
3 if (isset($_POST['mail'])){
4     if (file_exists(preg_split('/@/',$_POST['mail'])[0].'/index.php')){
5                 $conn=mysqli_connect($db_link,$db_user,$db_password,$db_name);
6         echo $_POST['mail'];
7                 $query=mysqli_query($conn,'SELECT mail_password FROM mail where mail_user="'.$_POST['mail'].'"');
8                 $i=mysqli_fetch_array($query,MYSQLI_ASSOC);
9         if ($_POST['hash']==$i['mail_password']){
10             http_response_code(200);
11         }
12         else{
13             http_response_code(400);
14         }
15     }
16     else{
17         http_response_code(500);
18     }
19 }
20 else{
21     http_response_code(400);
22 }
23
24 ?>