
Tugas Perkuliahan Mata Kuliah Sistem Operasi:
1. Menampilkan Informasi IP Address
2. Menampilkan Informasi Browser
3. Menampilkan Informasi Operating Systems yang digunakan
4. Menampilkan Informasi MAC Address
5. Menampilkan Informasi Counry
1. Script Untuk Menampilkan Informasi Ip Address
$ip_address=$_SERVER['REMOTE_ADDR'];
echo "$ip_address";
?>
2. Script Untuk Menampilkan Informasi Browser Dan Operating System
$info=$_SERVER['HTTP_USER_AGENT'];
echo "$info";
?>
script diatas sudah menjadi satu antara Informasi Browser dan Informasi Sistem Operasi
3. Script Untuk Menampilkan Informasi Negara
$mycountry = file('http://api.hostip.info/country.php?ip='.$_SERVER['REMOTE_ADDR']);
echo $mycountry[0];
?>
4. Script untuk MAC Address using PHP
/*
* Getting MAC Address using PHP
* Agus Candra Kurniawan
*/
ob_start(); // Turn on output buffering
system(‘ipconfig /all’); //Execute external program to display output
$mycom=ob_get_contents(); // Capture the output into a variable
ob_clean(); // Clean (erase) the output buffer
$findme = “Physical”;
$pmac = strpos($mycom, $findme); // Find the position of Physical text
$mac=substr($mycom,($pmac+36),17); // Get Physical Address
echo $mac;
?>
Tidak ada komentar:
Posting Komentar