Bakker Sikerült nem kell semmi hunbuk varázslat.:
Fogtam egy linket lekértem és nem 200 hanem 302-t kell figyelnem.
És néda mükszik ha jó az elfp akkor az visz ha nem jó az első - második akkor megy a 3-dik.. stb..
$code = strip_tags($_GET['code']);{
$db = new MySQLi($config['mysql_host'], $config['mysql_user'], $config['mysql_password'], $config['mysql_db']);
$db->set_charset('utf8');
$escapedCode = $db->real_escape_string($code);
$redirectResult = $db->query("SELECT `source`,`source2`,`source3`,`source4` FROM `channelList` WHERE `key` = '$escapedCode'");
$result = $redirectResult->fetch_object();
$url1 = $result->source;
$url2 = $result->source2;
$url3 = $result->source3;
$url4 = $result->source4;
$array = get_headers($url1);
$string = $array[0];
if(strpos($string,"302"))
{
header('Location: ' . $uri . $url1, null, 302);
exit();
$db->close();
}
else
{
$array = get_headers($url2);
$string = $array[0];
if(strpos($string,"302"))
{
header('Location: ' . $uri . $url2, null, 302);
exit();
$db->close();
}
else
{
$array = get_headers($url3);
$string = $array[0];
if(strpos($string,"302"))
{
header('Location: ' . $uri . $url3, null, 302);
exit();
$db->close();
}
else
{
$array = get_headers($url4);
$string = $array[0];
if(strpos($string,"302"))
{
header('Location: ' . $uri . $url4, null, 302);
exit();
$db->close();
}
else
{
http_response_code("204");die("Nincs találat");
exit();
$db->close();
}
$db->close();
}
}
}
}
?>