Friday, December 3, 2010

Script Menampilkan Ip Address, Browser, Operating Systems, Getting Mac Addrees dan Country using Languages Progams PHP

Awalnya sempat tersentak dengan tugas yang diberikan, karena mengapa? karena masih belum mengerti apa yang di inginkan oleh dosen.. tapi setelah ditanykan kembali Alhamdulillah mengerti.. Pak Hendro Dosen Sistem Operasi memberikan tugas membuat aplikasi yang dapat menampilkan Informasi IP Address, Informasi Browser, Informasi Sistem Operasi yang digunakan, Informasi MAC Address, dan Informasi Counry.

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;
?>

Reference
http://nazmulb.wordpress.com/2008/07/04/getting-mac-address-using-php/
http://wahyututorial.wordpress.com/2010/04/09/script-untuk-menampilkan-informasi-ip-dan-browser/
http://catment.blogspot.com/2010/03/script-untuk-menampilan-informasi-ip.html
Forum PHP Indonesia


Sekian dari Saya Agus Candra Kurniawan artikel yang berjudul "Script Menampilkan Ip Address, Browser, Operating Systems, Getting Mac Addrees dan Country using Languages Progams PHP", Semoga Bermanfaat bagi kita semua

Script Menampilkan Ip Address, Browser, Operating Systems, Getting Mac Addrees dan Country using Languages Progams PHP Rating: 4.5 Diposkan Oleh: Agus Candra Kurniawan