<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>www.kevincornwell.com &#187; PHP</title>
	<atom:link href="http://www.kevincornwell.com/blog/index.php/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kevincornwell.com/blog</link>
	<description></description>
	<lastBuildDate>Tue, 06 Jul 2010 02:50:29 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Maxmind and Google Maps Mashup [php]</title>
		<link>http://www.kevincornwell.com/blog/index.php/maxmind-and-google-maps-mashup/</link>
		<comments>http://www.kevincornwell.com/blog/index.php/maxmind-and-google-maps-mashup/#comments</comments>
		<pubDate>Sat, 08 Mar 2008 23:06:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.kevincornwell.com/blog/index.php/maxmind-and-google-maps-mashup/</guid>
		<description><![CDATA[I was bored today so I created a very simple and fast php script to plot the location for a given IP and display other IP information (such as lattitude, longitude, Country, State, Area code, ISP, etc.) on a Google Map using the Maxmind web service and the Google Maps API.

The link in the balloon [...]]]></description>
			<content:encoded><![CDATA[<p>I was bored today so I created a very simple and fast php script to plot the location for a given IP and display other IP information (such as lattitude, longitude, Country, State, Area code, ISP, etc.) on a Google Map using the Maxmind web service and the Google Maps API.</p>
<p><a href='http://www.kevincornwell.com/blog/wp-content/uploads/2008/03/maxmind_google_maps_mashup.GIF' title='maxmind_google_maps_mashup.GIF'><img src='http://www.kevincornwell.com/blog/wp-content/uploads/2008/03/maxmind_google_maps_mashup.thumbnail.GIF' alt='maxmind_google_maps_mashup.GIF' /></a></p>
<p>The link in the balloon points domaintools.com and does a whois lookup on the IP for detailed information on the ISP (internet service provider).</p>
<p><a href="http://www.kevincornwell.com/MaxmindGoogleMap/index.php?ip=98.195.83.50">Here is a working demo</a> (hard coded IP).<br />
<br/><br/></p>
<p>In order for this script to work on your site, you will need a <a href="http://www.maxmind.com/app/web_services#city">MaxMind GeoIP City/ISP/Organization Web Service Key</a> (50,000 lookups for $20.00) and a <a href="http://code.google.com/apis/maps/signup.html">Google Maps Key</a> (free).  There are other IP to Lat/Long Web services out there but Maxmind is by far the most accurate (none are 100% accurate).</p>
<p>To render the location of an IP on the map, send the IP via the query string such as&#8230;</p>
<pre>

http://www.yourDomain.com/MaxmindGoogleMap/index.php?ip=98.195.83.50
</pre>
<p><br/></p>
<p>Here is the script.  Copy the contents to a .php file and edit the 2 keys.  That&#8217;s it!</p>

<div class="wp_syntax"><div class="code"><pre class="php"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
        <span style="color: #808080; font-style: italic;">//////////////////////////////////////////////////////////////////////////////////////</span>
        <span style="color: #808080; font-style: italic;">///////////////  Maxmind/Google Maps Mashup by Kevin Cornwell ///////////////</span>
        <span style="color: #808080; font-style: italic;">///////////////                       Version 1.0                             ///////////////</span>
        <span style="color: #808080; font-style: italic;">///////////////          http://www.kevincornwell.com                ///////////////</span>
        <span style="color: #808080; font-style: italic;">/////////////////////////////////////////////////////////////////////////////////////</span>
&nbsp;
&nbsp;
&nbsp;
	<span style="color: #808080; font-style: italic;">// EDIT THE NEXT 2 KEYS</span>
&nbsp;
	<span style="color: #0000ff;">$maxmind_license_key</span>  = <span style="color: #ff0000;">&quot;foo&quot;</span>;    <span style="color: #808080; font-style: italic;">// Replace [foo] with your key.</span>
	<span style="color: #0000ff;">$google_maps_key</span>      = <span style="color: #ff0000;">&quot;bar&quot;</span>;    <span style="color: #808080; font-style: italic;">// Replace [bar] with your key.</span>
&nbsp;
&nbsp;
	<span style="color: #0000ff;">$zoom</span>                 = <span style="color: #cc66cc;">4</span>;          <span style="color: #808080; font-style: italic;">// Default zoom level.</span>
	<span style="color: #0000ff;">$lat</span>                  = <span style="color: #cc66cc;">39.232</span>;     <span style="color: #808080; font-style: italic;">// Center on this location by default when no IP is passed.</span>
	<span style="color: #0000ff;">$long</span>                 = <span style="color: #cc66cc;">-95.800</span>;    <span style="color: #808080; font-style: italic;">// Center on this location by default when no IP is passed.</span>
	<span style="color: #0000ff;">$ip</span>                   = <span style="color: #ff0000;">&quot;&quot;</span>;
	<span style="color: #0000ff;">$message</span>              = <span style="color: #ff0000;">&quot;Hello World&quot;</span>;   <span style="color: #808080; font-style: italic;">// Default message when no IP is passed.</span>
&nbsp;
&nbsp;
	<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #000066;">isset</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$_REQUEST</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'ip'</span><span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #0000ff;">$ip</span> = <span style="color: #0000ff;">$_REQUEST</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'ip'</span><span style="color: #66cc66;">&#93;</span>;
&nbsp;
		<span style="color: #0000ff;">$r</span> = maxmind_lookup<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$ip</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
		<span style="color: #0000ff;">$message</span> = <span style="color: #ff0000;">&quot;&lt;table cellspacing=0&gt;&lt;tr&gt;&lt;td align='right'&gt;&lt;b&gt;IP:&lt;/b&gt; &amp;nbsp;&lt;/td&gt;&lt;td&gt;&lt;a href='http://whois.domaintools.com/{$ip}'&gt;{$ip}&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align='right'&gt;&lt;b&gt;Country:&lt;/b&gt; &amp;nbsp;&lt;/td&gt;&lt;td&gt;{$r['country']}&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align='right'&gt;&lt;b&gt;Region:&lt;/b&gt; &amp;nbsp;&lt;/td&gt;&lt;td&gt;{$r['region']}&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align='right'&gt;&lt;b&gt;City:&lt;/b&gt; &amp;nbsp;&lt;/td&gt;&lt;td&gt;{$r['city']}&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align='right'&gt;&lt;b&gt;Zip:&lt;/b&gt; &amp;nbsp;&lt;/td&gt;&lt;td&gt;{$r['zip']}&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align='right'&gt;&lt;b&gt;Lat:&lt;/b&gt; &amp;nbsp;&lt;/td&gt;&lt;td&gt;{$r['lat']}&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align='right'&gt;&lt;b&gt;Long:&lt;/b&gt; &amp;nbsp;&lt;/td&gt;&lt;td&gt;{$r['long']}&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align='right'&gt;&lt;b&gt;Metro:&lt;/b&gt; &amp;nbsp;&lt;/td&gt;&lt;td&gt;{$r['metro_code']}&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align='right'&gt;&lt;b&gt;Area Code:&lt;/b&gt; &amp;nbsp;&lt;/td&gt;&lt;td&gt;{$r['area_code']}&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align='right'&gt;&lt;b&gt;ISP:&lt;/b&gt; &amp;nbsp;&lt;/td&gt;&lt;td&gt;{$r['isp']}&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td align='right'&gt;&lt;b&gt;Org:&lt;/b&gt; &amp;nbsp;&lt;/td&gt;&lt;td&gt;{$r['org']}&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&quot;</span>;
&nbsp;
		<span style="color: #0000ff;">$lat</span> = <span style="color: #0000ff;">$r</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'lat'</span><span style="color: #66cc66;">&#93;</span>;
		<span style="color: #0000ff;">$long</span> = <span style="color: #0000ff;">$r</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'long'</span><span style="color: #66cc66;">&#93;</span>;
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> maxmind_lookup<span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$ipaddress</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#123;</span>
&nbsp;
		<span style="color: #000066;">global</span> <span style="color: #0000ff;">$maxmind_license_key</span>;
&nbsp;
		<span style="color: #808080; font-style: italic;">// Returns:ISO 3166 Two-letter Country Code, Region Code, City, Postal Code, </span>
		<span style="color: #808080; font-style: italic;">// Latitude, Longitude, Metropolitan Code, Area Code, ISP, Organization.</span>
&nbsp;
&nbsp;
		<span style="color: #0000ff;">$query</span> = <span style="color: #ff0000;">&quot;http://maxmind.com:8010/f?l=&quot;</span> . <span style="color: #0000ff;">$maxmind_license_key</span> . <span style="color: #ff0000;">&quot;&amp;i=&quot;</span> . <span style="color: #0000ff;">$ipaddress</span>;
		<span style="color: #0000ff;">$url</span> = <span style="color: #000066;">parse_url</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$query</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0000ff;">$host</span> = <span style="color: #0000ff;">$url</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;host&quot;</span><span style="color: #66cc66;">&#93;</span>;
		<span style="color: #0000ff;">$path</span> = <span style="color: #0000ff;">$url</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;path&quot;</span><span style="color: #66cc66;">&#93;</span> . <span style="color: #ff0000;">&quot;?&quot;</span> . <span style="color: #0000ff;">$url</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">&quot;query&quot;</span><span style="color: #66cc66;">&#93;</span>;
		<span style="color: #0000ff;">$timeout</span> = <span style="color: #cc66cc;">1</span>;
		<span style="color: #0000ff;">$fp</span> = <span style="color: #000066;">fsockopen</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$host</span>, <span style="color: #cc66cc;">8010</span>, <span style="color: #0000ff;">$errno</span>, <span style="color: #0000ff;">$errstr</span>, <span style="color: #0000ff;">$timeout</span><span style="color: #66cc66;">&#41;</span>
		or <span style="color: #000066;">die</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">'Can not open connection to maxmind server.'</span><span style="color: #66cc66;">&#41;</span>;
		<span style="color: #0000ff;">$buf</span> = <span style="color: #ff0000;">&quot;&quot;</span>;
&nbsp;
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$fp</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #000066;">fputs</span> <span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$fp</span>, <span style="color: #ff0000;">&quot;GET $path HTTP/1.0<span style="color: #000099; font-weight: bold;">\n</span>Host: &quot;</span> . <span style="color: #0000ff;">$host</span> . <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #b1b100;">while</span> <span style="color: #66cc66;">&#40;</span>!<span style="color: #000066;">feof</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$fp</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
				<span style="color: #0000ff;">$buf</span> .= <span style="color: #000066;">fgets</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$fp</span>, <span style="color: #cc66cc;">128</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #66cc66;">&#125;</span>
			<span style="color: #0000ff;">$lines</span> = <span style="color: #000066;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>, <span style="color: #0000ff;">$buf</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0000ff;">$data</span> = <span style="color: #0000ff;">$lines</span><span style="color: #66cc66;">&#91;</span><span style="color: #000066;">count</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$lines</span><span style="color: #66cc66;">&#41;</span><span style="color: #cc66cc;">-1</span><span style="color: #66cc66;">&#93;</span>;
			<span style="color: #000066;">fclose</span><span style="color: #66cc66;">&#40;</span><span style="color: #0000ff;">$fp</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #0000ff;">$arrMaxmind</span> = <span style="color: #000066;">split</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;,&quot;</span>, <span style="color: #0000ff;">$data</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0000ff;">$arrMaxmind</span> = <span style="color: #000066;">str_replace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span>, <span style="color: #ff0000;">&quot;&quot;</span>, <span style="color: #0000ff;">$arrMaxmind</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #0000ff;">$arrMaxmind</span> = <span style="color: #000066;">str_replace</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;,&quot;</span>, <span style="color: #ff0000;">&quot; &quot;</span>, <span style="color: #0000ff;">$arrMaxmind</span><span style="color: #66cc66;">&#41;</span>;
&nbsp;
			<span style="color: #0000ff;">$r</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'country'</span><span style="color: #66cc66;">&#93;</span> 		= <span style="color: #0000ff;">$arrMaxmind</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>;
			<span style="color: #0000ff;">$r</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'region'</span><span style="color: #66cc66;">&#93;</span> 		= <span style="color: #0000ff;">$arrMaxmind</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #66cc66;">&#93;</span>;
			<span style="color: #0000ff;">$r</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'city'</span><span style="color: #66cc66;">&#93;</span> 		= <span style="color: #0000ff;">$arrMaxmind</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#93;</span>;
			<span style="color: #0000ff;">$r</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'zip'</span><span style="color: #66cc66;">&#93;</span> 		= <span style="color: #0000ff;">$arrMaxmind</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #66cc66;">&#93;</span>;
			<span style="color: #0000ff;">$r</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'lat'</span><span style="color: #66cc66;">&#93;</span> 		= <span style="color: #0000ff;">$arrMaxmind</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #66cc66;">&#93;</span>;
			<span style="color: #0000ff;">$r</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'long'</span><span style="color: #66cc66;">&#93;</span> 		= <span style="color: #0000ff;">$arrMaxmind</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #66cc66;">&#93;</span>;
			<span style="color: #0000ff;">$r</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'metro_code'</span><span style="color: #66cc66;">&#93;</span> 	= <span style="color: #0000ff;">$arrMaxmind</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">6</span><span style="color: #66cc66;">&#93;</span>;
			<span style="color: #0000ff;">$r</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'area_code'</span><span style="color: #66cc66;">&#93;</span> 	= <span style="color: #0000ff;">$arrMaxmind</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">7</span><span style="color: #66cc66;">&#93;</span>;
			<span style="color: #0000ff;">$r</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'isp'</span><span style="color: #66cc66;">&#93;</span> 		= <span style="color: #0000ff;">$arrMaxmind</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">8</span><span style="color: #66cc66;">&#93;</span>;
			<span style="color: #0000ff;">$r</span><span style="color: #66cc66;">&#91;</span><span style="color: #ff0000;">'org'</span><span style="color: #66cc66;">&#93;</span> 		= <span style="color: #0000ff;">$arrMaxmind</span><span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">9</span><span style="color: #66cc66;">&#93;</span>;
&nbsp;
		<span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span>
			<span style="color: #b1b100;">return</span> <span style="color: #000000; font-weight: bold;">false</span>;
		<span style="color: #66cc66;">&#125;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #0000ff;">$r</span>;
	<span style="color: #66cc66;">&#125;</span>		
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;!DOCTYPE html <span style="color: #000000; font-weight: bold;">PUBLIC</span> <span style="color: #ff0000;">&quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;</span>
  <span style="color: #ff0000;">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;</span>&gt;
&lt;html xmlns=<span style="color: #ff0000;">&quot;http://www.w3.org/1999/xhtml&quot;</span>&gt;
  &lt;head&gt;
    &lt;meta http-equiv=<span style="color: #ff0000;">&quot;content-type&quot;</span> content=<span style="color: #ff0000;">&quot;text/html; charset=utf-8&quot;</span>/&gt;
    &lt;title&gt;&lt;?php <span style="color: #000066;">echo</span> <span style="color: #0000ff;">$ip</span> ?&gt;&lt;/title&gt;
    &lt;script src=<span style="color: #ff0000;">&quot;http://maps.google.com/maps?file=api&amp;amp;v=2&amp;amp;key=&lt;?php echo $google_maps_key ?&gt;&quot;</span>
      type=<span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;&lt;/script&gt;
    &lt;script type=<span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;
&nbsp;
    <span style="color: #808080; font-style: italic;">//&lt;![CDATA[</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> load<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> 
	<span style="color: #66cc66;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>GBrowserIsCompatible<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span> 
		<span style="color: #66cc66;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">var</span> map = <span style="color: #000000; font-weight: bold;">new</span> GMap2<span style="color: #66cc66;">&#40;</span>document.getElementById<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;map&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
			map.addControl<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> GLargeMapControl<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
			map.addControl<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> GMapTypeControl<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
			map.setCenter<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> GLatLng<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000066;">echo</span> <span style="color: #0000ff;">$lat</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>, <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000066;">echo</span> <span style="color: #0000ff;">$long</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #66cc66;">&#41;</span>, <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000066;">echo</span> <span style="color: #0000ff;">$zoom</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #66cc66;">&#41;</span>;
			<span style="color: #000000; font-weight: bold;">var</span> marker = <span style="color: #000000; font-weight: bold;">new</span> GMarker<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> GLatLng<span style="color: #66cc66;">&#40;</span><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000066;">echo</span> <span style="color: #0000ff;">$lat</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>, <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000066;">echo</span> <span style="color: #0000ff;">$long</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;
			marker.html = <span style="color: #ff0000;">&quot;&lt;?php echo $message ?&gt;&quot;</span>;
			GEvent.addListener<span style="color: #66cc66;">&#40;</span>marker, <span style="color: #ff0000;">'click'</span>, <span style="color: #000000; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>marker.openInfoWindowHtml<span style="color: #66cc66;">&#40;</span>marker.html<span style="color: #66cc66;">&#41;</span>; <span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;
			map.addOverlay<span style="color: #66cc66;">&#40;</span>marker<span style="color: #66cc66;">&#41;</span>;
			marker.openInfoWindowHtml<span style="color: #66cc66;">&#40;</span>marker.html<span style="color: #66cc66;">&#41;</span>;
		<span style="color: #66cc66;">&#125;</span>
	<span style="color: #66cc66;">&#125;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">//]]&gt;</span>
    <span style="color: #000000; font-weight: bold;">&lt;/script&gt;</span>
  &lt;/head&gt;
  &lt;body onload=<span style="color: #ff0000;">&quot;load()&quot;</span> onunload=<span style="color: #ff0000;">&quot;GUnload()&quot;</span>&gt;
    &lt;div id=<span style="color: #ff0000;">&quot;map&quot;</span> style=<span style="color: #ff0000;">&quot;width:800px;height:600px&quot;</span>&gt;&lt;/div&gt;
  &lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>If you liked my script, post a thanks below.<br />
:)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.kevincornwell.com/blog/index.php/maxmind-and-google-maps-mashup/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Run php 4.x and php 5.2.x on the same machine with IIS 6.0 as ISAPI.</title>
		<link>http://www.kevincornwell.com/blog/index.php/run-php-4x-and-php-52x-on-the-same-machine-with-iis-60-as-isapi/</link>
		<comments>http://www.kevincornwell.com/blog/index.php/run-php-4x-and-php-52x-on-the-same-machine-with-iis-60-as-isapi/#comments</comments>
		<pubDate>Mon, 25 Jun 2007 19:28:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.kevincornwell.com/blog/index.php/run-php-4x-and-php-52x-on-the-same-machine-with-iis-60-as-isapi/</guid>
		<description><![CDATA[Run php 4 and php 5.2.x on the same machine with IIS 6.0 as ISAPI.

Extract the ZIP packages of both php 4 &#38; php 5 (not the Windows Installer) to c:\php4 &#38; c:\php5 respectively.
Setup the corresponding php.ini files in c:\php4 and c:\php5
Add the Web Service Extensions for php4 and php5. For php4 use c:\php4\sapi\php4isapi.dll, php5 [...]]]></description>
			<content:encoded><![CDATA[<p>Run php 4 and php 5.2.x on the same machine with IIS 6.0 as ISAPI.</p>
<ol>
<li>Extract the ZIP packages of both php 4 &amp; php 5 (not the Windows Installer) to c:\php4 &amp; c:\php5 respectively.</li>
<li>Setup the corresponding php.ini files in c:\php4 and c:\php5</li>
<li>Add the Web Service Extensions for php4 and php5. For php4 use c:\php4\sapi\php4isapi.dll, php5 use c:\php5\php5isapi.dll</li>
<li>Add the following registry keys:
<pre>
HKEY_LOCAL_MACHINE\SOFTWARE\PHP\5\IniFilePath -> c:\php5
HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath -> c:\php4
</pre>
</li>
<li>Add c:\php4 to the PATH environment variable.</li>
<li>Add c:\php5 to the PATH environment variable.</li>
<li>Associate each web site in IIS with the corresponding php version.</li>
<li>Reboot.</li>
</ol>
<p><span style="color:red;">Note: In IIS you still need to to have the DLL&#8217;s in the &#8220;Allowed Web Service Extensions List&#8221; and the extensions in the appropriate &#8220;Application Configuration&#8221; settings for the given websites/applications.</span></p>
<p><span id="more-80"></span><br />
More information on the php.ini file (taken from the install.txt in the distro):</p>
<blockquote><p>
Chapter 5. Runtime Configuration</p>
<p>The configuration file</p>
<p>   The configuration file (called php3.ini in PHP 3, and simply php.ini as<br />
   of PHP 4) is read when PHP starts up. For the server module versions of<br />
   PHP, this happens only once when the web server is started. For the CGI<br />
   and CLI version, it happens on every invocation.</p>
<p>   php.ini is searched in these locations (in order):</p>
<p>     * SAPI module specific location (PHPIniDir directive in Apache 2, -c<br />
       command line option in CGI and CLI, php_ini parameter in NSAPI,<br />
       PHP_INI_PATH environment variable in THTTPD)<br />
     * The PHPRC environment variable. Before PHP 5.2.0 this was checked<br />
       after the registry key mentioned below.<br />
     * As of PHP 5.2.0, the following registry locations are searched in<br />
       order: HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y.z\IniFilePath,<br />
       HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x.y\IniFilePath and<br />
       HKEY_LOCAL_MACHINE\SOFTWARE\PHP\x\IniFilePath, where x, y and z<br />
       mean the PHP major, minor and release versions.<br />
     * HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath (Windows Registry<br />
       location)<br />
     * Current working directory (except CLI)<br />
     * The web server&#8217;s directory (for SAPI modules), or directory of PHP<br />
       (otherwise in Windows)<br />
     * Windows directory (C:\windows or C:\winnt) (for Windows), or<br />
       &#8211;with-config-file-path compile time option</p>
<p>   If php-SAPI.ini exists (where SAPI is used SAPI, so the filename is<br />
   e.g. php-cli.ini or php-apache.ini), it&#8217;s used instead of php.ini. SAPI<br />
   name can be determined by php_sapi_name().</p>
<p>     Note: The Apache web server changes the directory to root at startup<br />
     causing PHP to attempt to read php.ini from the root filesystem if<br />
     it exists.</p>
<p>   The php.ini directives handled by extensions are documented<br />
   respectively on the pages of the extensions themselves. The list of the<br />
   core directives is available in the appendix. Probably not all PHP<br />
   directives are documented in the manual though. For a complete list of<br />
   directives available in your PHP version, please read your well<br />
   commented php.ini file. Alternatively, you may find the the latest<br />
   php.ini from CVS helpful too.</p>
<p>   Example 5-1. php.ini example<br />
; any text on a line after an unquoted semicolon (;) is ignored<br />
[php] ; section markers (text within square brackets) are also ignored<br />
; Boolean values can be set to either:<br />
;    true, on, yes<br />
; or false, off, no, none<br />
register_globals = off<br />
track_errors = yes</p>
<p>; you can enclose strings in double-quotes<br />
include_path = &#8220;.:/usr/local/lib/php&#8221;</p>
<p>; backslashes are treated the same as any other character<br />
include_path = &#8220;.;c:\php\lib&#8221;</p>
<p>   Since PHP 5.1.0, it is possible to refer to existing .ini variables<br />
   from within .ini files. Example: open_basedir = ${open_basedir}<br />
   &#8220;:/new/dir&#8221;.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.kevincornwell.com/blog/index.php/run-php-4x-and-php-52x-on-the-same-machine-with-iis-60-as-isapi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to make php (32 bit) run on XP x64 (64 bit).</title>
		<link>http://www.kevincornwell.com/blog/index.php/how-to-make-php-run-in-x64-64-bit/</link>
		<comments>http://www.kevincornwell.com/blog/index.php/how-to-make-php-run-in-x64-64-bit/#comments</comments>
		<pubDate>Thu, 21 Dec 2006 15:58:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[XP]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.kevincornwell.com/blog/index.php/how-to-make-php-run-in-x64-64-bit/</guid>
		<description><![CDATA[From command line:

cd c:\inetpub\adminscripts
cscript adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1

Thats it.
Related MS Article
]]></description>
			<content:encoded><![CDATA[<p>From command line:</p>
<pre>
cd c:\inetpub\adminscripts
cscript adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 1
</pre>
<p>Thats it.</p>
<p><a href="http://support.microsoft.com/?id=894435">Related MS Article</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.kevincornwell.com/blog/index.php/how-to-make-php-run-in-x64-64-bit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
