Answer the question
In order to leave comments, you need to log in
How to implement 2 "requests" at the same time?
How to implement it correctly?
require_once '../engine/config.php';
require_once '../engine/db.php';
header('Content-TYPE: application/json');
if(empty($_GET['name'])){echo 'error';}
if(empty($_GET2['password'])){echo 'error';}
else {
$query = mysqli_query($connection, ("SELECT * FROM `users` WHERE `name`='".$_GET['name']."'"));
$query2 = mysqli_query($connection, ("SELECT * FROM `users` WHERE `password`='".$_GET2['password']."'"));
$result = mysqli_fetch_assoc($query, $query2);
if($result) {
$result = array(
'name' => $result['name'],
'tgdays' => $result['tgdays'],
'hwid' => $result['hwid']
);
echo json_encode($result);
}
else{
echo 'error';
}
}
Answer the question
In order to leave comments, you need to log in
1) sql injection. At least check it out.
2) $_GET - explore.
3) the answer to your question is
"SELECT * FROM `users` WHERE `name`=name and password= password.
Write what you want to get as a result?
It looks like an imitation of the implementation of some task. Non-working implementation.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question