0
Hi, I’m wanting to do a check on several links, check if they are working, I’m using the code below for this, but it only works when I test locally on the server of my pc, when I raise it to the hosting server does not work properly. On the hosting server links that have type ports http://179.106. 7.93:5656/System, does not show as Operative even if it is. They could help me, or even give me another strategy, because what I’m using takes a long time to load. To using Mysql database to store links
function url_existe($url1) {
$ch = curl_init($url1);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
return ($code == 200); // verifica se recebe "status OK"
}
while($lista_url_a = mysql_fetch_assoc($lista_url)) {
$url = $lista_url_a['url'];
$id_url = $lista_url_a['id'];
$url2 = $url;
if (url_existe($url2))
$atualiza_url = mysql_query("update url set status = 'OPERANTE' where id= $id_url");
else
$atualiza_url = mysql_query("update url set status = 'INOPERANTE' where id= $id_url");
}
hi friend, occurred the same problem, in my local network works, showing really who is active, but when I go up to hosting does not work
– Naaliel Corrêa