Find visitor’s country using his ip address

Pocket

I have created a small php class that parses the IP2country.csv file and finds the visitor’s country using his ip address.

Installations:

First download the latest ip address database from http://software77.net/geo-ip/
In right sidebar you will see Download, Select IPV4 CSV (gz). Here you can also download .zip file
Then download the file.
Place the file in the same folder where this script is.

Note:You can also change the file location of IpToCountry.csv just pase this file location to parseCsv() function.

And then

1. include the ip2address.php

require “ip2address.php”;
2. Create a new object of IP2Country
$ip = new IpToCountry($client_ip);
3. call the parseCSV
$ip->parseCsv();
4. to get country name
$ip->getCountryName()
5. to get country code
$ip->getCountryCode()
6. Just for debug purpose use
echo $ip;
7. That’s it, enjoy.
8. If you use this class just let me know through comment.

If you find any bug please report it to me.

The class is IpToCountry and can be used the following way.

<?php
require 'ip2address.php';
$client_ip = '202.166.217.94';

$ip = new IpToCountry($client_ip);
$ip->parseCsv();
echo $ip;

?>

Download the zipped version from http://www.samundra.com.np/downloads/ip2address.zip

ip2address.zip contains the following files
ip2address.php- This file contains the main class sourcecode
test.php – This file contains the test code.
README.txt – How to use this class file and just replica of this article or Documentation.

Find computer system model in windows7

Pocket

At first click in windows logo button (start) then click in searchbox type “system information” as shown below.

System Information

Then click in the system information.You will get a system refreshing information, wait for a while. After system information has been loaded completely.

Select “System Summary” on the left pane and in right pane “System Manufacturer, System Model, System Type”. See the system model, that is the model of your computer. See the image below, just to have clear idea where this information is displayed.

System Model

Hope this helps you, there are also other ways to find it. But this is the easiest method which doesn’t require any external software.