-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.php
32 lines (26 loc) · 924 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
require_once 'db_config.php';
$link = mysqli_connect($host, $user, $password, $database)
or die("Ошибка " . mysqli_error($link));
if($_REQUEST['proc'] == "logIn") {
$login = $_REQUEST['login'];
$password = $_REQUEST['password'];
$query="SELECT EXISTS (SELECT * FROM clients WHERE login = '".$login."' and password = '".$password."')";
$result = mysqli_query($link, $query) or die("Ошибка " . mysqli_error($link));
$row = mysqli_fetch_row($result);
if ($row[0] > 0)
{
$res[Eee] = "yes";
}
else $res[Eee] = "no";
}
//$query ="SELECT * FROM test";
//$result = mysqli_query($link, $query) or die("Ошибка " . mysqli_error($link));
//if($result)
//{
// $res[Aaa] = $_REQUEST['name'];
// $res[Eee] = "secseeeee";
//}
//else echo "nnnnn!"; -->
echo (json_encode($res));
?>