Web Hosting Talk







View Full Version : Anybody knows a 'Your Computer Information' script?


zuriha
01-09-2006, 08:11 AM
I would like to create a page where the users can view their own computer info.

thanks in advance

Burhan
01-09-2006, 08:49 AM
What kind of information? The only thing you can do here without using some sort of security-enabled ActiveX control or Java applet is what is passed to you from the referer.

This is generally the operating system and browser version that the person is using.

If you want to show the number of drives on the system, you will need to hire someone to write a ActiveX control or Java applet that does this (then you will need to get it digitally signed and have the user agree to download and install it).

zuriha
01-09-2006, 09:00 AM
Well at the start I would like:


Browser
Color Depth
OS
OS Language
Screen Resolution
Users Country

After that maybe I will work on more detailed info that requires activex.

Burhan
01-09-2006, 09:51 AM
Browser:
OS:

After you have configured your php installation (http://www.php.net/manual/nl/ref.misc.php#ini.browscap) with the browscap.ini file (download it here (http://www.garykeith.com/browsers/downloads.asp)) you can use the following:

$info = get_browser();
echo $info->browser.'('.$info->parent.')';
echo $info->os;

Color Depth:

<script language="javascript">
document.write(window.screen.colorDepth);
</script>

Screen Resolution:

<script language="javascript">
document.write(screen.width+'x'+screen.height);
</script>

Users Country:

There are lots of ways to get this information. One of them is to use the free Geo IP database by Maxmind.

1. Download the binary version of the free IP database (http://www.maxmind.com/app/geoip_country).
2. Install Net_GeoIP (http://pear.php.net/package/Net_GeoIP) from PEAR

Then, use this:

$geoip = Net_GeoIP::getInstance('/path/to/geoipdb.dat', Net_GeoIP::SHARED_MEMORY);
echo $geoip->lookupCountryName($_SERVER['REMOTE_ADDR']);

zuriha
01-09-2006, 11:34 AM
thank you very much for the info!