Location: PHPKode > scripts > IP To Country Lookup PHP Script > ip-to-country/ip-to-country-config.php
<?php
//error_reporting( E_ALL );
/*
IP To Country PHP Script by Mike Challis
Free PHP Scripts - www.642weather.com/weather/scripts.php
Download         - www.642weather.com/weather/scripts/ip-to-country.zip
Live Demo        - www.642weather.com/weather/ip-to-country.php
Contact Mike     - www.642weather.com/weather/contact_us.php

Version: 1.50 - 06-Dec-2008 see changelog.txt for changes

You are free to use and modify the code

This php code provided "as is", and Long Beach Weather (Michael Challis)
disclaims any and all warranties, whether express or implied, including
(without limitation) any implied warranties of merchantability or
fitness for a particular purpose.

Copyright (C) 2008 Mike Challis  (www.642weather.com/weather/contact_us.php)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

*/
$C = array();

// begin settings

// url to image folder, no slash on end!  
$C['url_to_imgs']  = 'http://www.yoursite.com/country-flags';

// server path to image folder, no slash on end!  
$C['path_to_imgs'] = './country-flags'; 

// country-flags image type
$C['country_img_type'] = '.png';

// name of the ip-to-country.php page
// if you rename the page, this must be changed correctly for the script to post to it
$C['file_name'] = 'ip-to-country.php';

// mysql database settings (you must already have a mysql database)
$C['dbhost'] = 'localhost'; // host
$C['dbname'] = ''; // database name
$C['dbuser'] = ''; // database user
$C['dbpass'] = ''; // database password

// load-ip-data.php can use non-buffered output
// (prints status messages to screen while database update is happening
// "Please allow (10-30 seconds) for the data to load..."
// can be disabled if your PHP does not support it, but you will have a white screen
// while the data is loading
//$C['non_buffer']  = 0; // off
$C['non_buffer'] = 1; // on

// do you have the ip-to-country.php script included in your own template page?
// when include is on, the $C['header'] and $C['footer'] are ignored
//$C['include']  = 1; // on
$C['include'] = 0; // off

// text output and xml output can be used for advanced uses of the country to ip data by remote lookup
// e-commerce is an example of a use for country to IP (see readme.txt for more info of advanced uses)
// this option disables both xml and text output options
//$C['enable_xml'] = 1; // on  
$C['enable_xml']  = 0; // off


$C['header'] = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-US">
<head>
<title>IP To Country Lookup</title>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=ISO-8859-1" />
</head>
<body>

<h3>IP To Country Lookup</h3>

';

$C['footer'] = '

</body>
</html>
';

$C['credit'] = '
<br />
<br />

IP To Country Lookup
<a href="http://www.642weather.com/weather/scripts.php">PHP Script by Mike Challis</a>
';

// end settings   


?>


Return current item: IP To Country Lookup PHP Script