03-11-2012
You can use geoip....
Check out the
geoip apis for PHP here:
Quote:
There are three methods of querying the GeoIP databases from PHP. The easiest to setup is the Pure PHP API. The setup for the high performance PHP extension and mod_geoip APIs is more advanced.
Pure PHP module
Download pure PHP module. Free GeoLite Country and GeoLite City databases are available.
A port to PHP5 of the PHP API is available from PEAR.
The Pure PHP API is cross-platform, works on Windows as well as Linux, and does not require Apache, nor does it require the C API.
PHP Extension on PECL
Download a PHP extension that allows you to embed the GeoIP C Library inside PHP for improved performance. There is a new fork with a more complete implementation.
Using mod_geoip with PHP
For improved performance, you can access the mod_geoip from PHP. There is a trade-off between performance and ease of installation - the Apache module is faster (benchmark), but the pure PHP module is much easier to install.
7 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am interested in finding out if there is a reliable and economical way for extracting user's location based on his ip address, using php
I tried to get the job done using ip2location.com, but I am not happy how it deals with result inconsistently. (2 Replies)
Discussion started by: siftin-com
2 Replies
2. Shell Programming and Scripting
I m trying to throw back html page when a file is found.While throwing back html page, the background image is not coming. I am using Apache server.Please suggest how to resolve...
#!/bin/ksh
echo -e "Content-type: text/html\n\n"
echo "<html><head></head><body background=\"/asc/ppp.jpg\">"... (10 Replies)
Discussion started by: ravi18s
10 Replies
3. Shell Programming and Scripting
Hi
I know how to pass data from client side (html file) to server using CGI script (POST method).
I also know how to re-create the html page from server side after receiving the data (using printf).
However I want to write static pages on client side (only the structure), and only to pass... (0 Replies)
Discussion started by: naamabm
0 Replies
4. Web Development
HI guys/gals,
I like to add some personal touches to a welcome image on our mediawiki site, and have the welcome be displayed in the, presumed, language of the visitor.
Standard would be English, but if the IP or browser or OS is set to be in India, I want to display the message in Urdu for... (5 Replies)
Discussion started by: lawstudent
5 Replies
5. Shell Programming and Scripting
I do have a big text file
>A1
ACFGTSDCHG_GDF
DGHA
>A2
A_FGGSD_HG_GSF
DGTA
>A3
AC_GSDD_TU_GDF
DGH_
..
...
there are equal number of characters within all the sub-headers. I want to parse out all the characters under each sub-header from user specified locations. For example, I want... (5 Replies)
Discussion started by: Lucky Ali
5 Replies
6. Red Hat
Hi All,
I have RHEL 5 installed in my system. Something must has happened because when i reboot the server, it came with many error..
/usr/bin/rhgb-client -- error while loading shared libraries: libpopt.so.0. Can't open shared object files. No such file/directory
It finnaly ends with the... (6 Replies)
Discussion started by: IgnitedMind
6 Replies
7. What is on Your Mind?
Should have done this 10 years ago, so better late than never:
Just added a "loading" animation to the the man page repositories when they load, especially since some are very large and take many seconds to load.
See for example:
https://www.unix.com/man-page-opensolaris-repository.php
... (1 Reply)
Discussion started by: Neo
1 Replies
LEARN ABOUT DEBIAN
php-config5
php-config(1) Scripting Language php-config(1)
NAME
php-config - get information about PHP configuration and compile options
SYNOPSIS
php-config [options]
DESCRIPTION
php-config is a simple shell script for obtaining information about installed PHP configuration.
OPTIONS
--prefix Directory prefix where PHP is installed, e.g. /usr/local
--includes List of -I options with all include files
--ldflags LD Flags which PHP was compiled with
--libs Extra libraries which PHP was compiled with
--man-dir The directory prefix where the manpages is installed
--extension-dir
Directory where extensions are searched by default
--include-dir Directory prefix where header files are installed by default
--php-binary Full path to php CLI or CGI binary
--php-sapis Show all SAPI modules installed on the Debian system
--configure-options
Configure options to recreate configuration of current PHP installation
--version PHP version
--vernum PHP version as integer
SEE ALSO
php(1)
VERSION INFORMATION
This manpage describes php, version 5.4.4-14+deb7u14.
COPYRIGHT
Copyright (C) 1997-2010 The PHP Group
This source file is subject to version 3.01 of the PHP license, that is bundled with this package in the file LICENSE, and is available
through the world-wide-web at the following url:
http://www.php.net/license/3_01.txt
If you did not receive a copy of the PHP license and are unable to obtain it through the world-wide-web, please send a note to
license@php.net so we can mail you a copy immediately.
The PHP Group 2010 php-config(1)