-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
32 lines (26 loc) · 898 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
function curl_info($url){
$ch = curl_init();
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt( $ch, CURLOPT_HEADER, 1);
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );
curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 1 );
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 1 );
$content = curl_exec( $ch );
$info = curl_getinfo( $ch );
return $info;
}
$site = 'http://intranettommasi.ddns.net:1989/intranet';
$info = curl_info( $site );
if( $info['http_code']==200 ) {
echo '<u>'.$site . '</u> - <strong>está no ar!!</strong><br />';
} else {
echo '<u>'.$site . '</u> - está fora do ar<br />';
}
$site = 'http://www.locaweba.com.br';
$info = curl_info( $site );
if( $info['http_code']==200 ) {
echo '<u>'.$site . '</u> - <strong>está no ar!!</strong><br />';
} else {
echo '<u>'.$site . '</u> - está fora do ar<br />';
}