I'm trying to code a php page that checks if the $_GET['uuid']
matches the value in the database and if the ip address of the current visitor matches the ip address of $_GET['uuid']
stored in the database.
Here is the code:
if(isset($_GET['uuid'])){
$uuid = $_GET['uuid'];
include('database.php');
$sql = "SELECT * FROM `ips`";
$sql2 = "SELECT * FROM `ips` WHERE `uuid` = '". $uuid ."'";
foreach($mysqli->query($sql) as $row){
$ipss = $row;
}
foreach($mysqli->query($sql2) as $ipsrrr){
$ipsr = $ipsrrr;
}
if($ipss['uuid'] == $uuid && $ipsr['ip'] == $gip){
$allowed = 1;
}else{
header('Location: index.php');
exit(0);
}
}else{
header('Location: index.php');
exit(0);
}
I don't known why but i get stuck in the foreach loop. I get a blank page with an loading icon.