v2.5.2
Giriş yap

Site Aktif Tutma

frexx
449 defa görüntülendi

Merhaba, yine ben ve yine bir şey yapmaya çalışıyorum. Bir site sunucusu düşünelim ve ben bu sitenin sunucusuna normal girmeden nasıl bir giriş sağlarım. Mesala örnek olarak uptime siteleri. Discord botlarını vb 7/24 aktif edilmesini sağlıyor insan eliyle girilmeden.

Cevap yaz
Cevaplar (2)
frexx
1146 gün önce

@wraithdev2 İşe yaramadı kardeşim

wraithdev2
1146 gün önce
<?
function ping($host, $port, $timeout) { 
  $tB = microtime(true); 
  $fP = fSockOpen($host, $port, $errno, $errstr, $timeout); 
  if (!$fP) { return "down"; } 
  $tA = microtime(true); 
  return round((($tA - $tB) * 1000), 0)." ms"; 
}

function autoping(){
    // Google.com'un 80 numaralı portunu 10 saniye timeout ile pingler.
    ping("www.google.com", 80, 10);
}
while(true){
    autoping();
    // 5 Saniye bekle
    sleep(5);
}