<?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>Robert Kern &#187; PHP</title> <atom:link href="http://www.robertkern.com/tags/php/feed" rel="self" type="application/rss+xml" /><link>http://www.robertkern.com</link> <description>PHP Web developer</description> <lastBuildDate>Tue, 07 Feb 2012 00:34:47 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <cloud
domain='www.robertkern.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' /> <item><title>Move data from one web server to another using wget</title><link>http://www.robertkern.com/hosting/move-data-from-one-web-server-to-another-using-wget.html</link> <comments>http://www.robertkern.com/hosting/move-data-from-one-web-server-to-another-using-wget.html#comments</comments> <pubDate>Thu, 28 Aug 2008 16:00:01 +0000</pubDate> <dc:creator>Robert Kern</dc:creator> <category><![CDATA[Hosting]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[wget]]></category><guid
isPermaLink="false">http://www.robertkern.com/?p=147</guid> <description><![CDATA[Recently I needed to move a large amount of data from one web server to another. I was moving about 50 websites to a new server. I didnt want to download all the data via FTP and then upload it to the new server (especially not from here in Honduras where the Internet isnt as [...]]]></description> <content:encoded><![CDATA[<p>Recently I needed to move a large amount of data from one web server to another.  I was moving about 50 websites to a new server.  I didnt want to download all the data via FTP and then upload it to the new server (especially not from here in Honduras where the Internet isnt as fast as I would have liked).  I didnt have SSH access to the old server due to shared hosting security issues.  How did I move it all in only a few minutes?<br
/> <span
id="more-147"></span><br
/> I had asked the host for a backup of my home directory which contained the data for all the sites.  Due to some annoying permissions problems, the backup they provided me didnt contain all the files (which I discovered as I begun doing the scheduled transfer).  The timezone differences meant that while I was working at a comfortable 8am, the time in NZ was around 2am.  I couldnt ask for another backup and expect to have it in time, so I had to think of a better way.<br
/> Then I remembered wget.  An amazing Unix tool that I use very often.  I usually only use it for http requests, and had forgotten it could do ftp as well.  So while I didnt have SSH access to the old server, I did have FTP access.  I used the following wget command to log into FTP and download every single file under my home directory to the new server (which I did have SSH access to as it is a VPS that I own):</p><p><strong>wget -r -N -l inf ftp://user:pwd@ftp.example.com/foldername</strong></p><p>Within a few minutes (the two servers were both based in Auckland and the transfer speed was incredibly fast) all the data had been transferred across.  I only had to re-organise the location of the data to the appropriate places, backup and import the MySQL databases to the new server and wa-la it was done.  Thankfully, the 50-odd sites are running on the Frondiz CMS which means that the installation on the new server was very quick (ie, I didnt have to setup 50 different sites in apache, just a few, one that contains lots of domain names).</p> ]]></content:encoded> <wfw:commentRss>http://www.robertkern.com/hosting/move-data-from-one-web-server-to-another-using-wget.html/feed</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>Use PHP to make alternate coloured rows</title><link>http://www.robertkern.com/php/use-php-to-make-alternate-coloured-rows.html</link> <comments>http://www.robertkern.com/php/use-php-to-make-alternate-coloured-rows.html#comments</comments> <pubDate>Thu, 28 Aug 2008 14:56:39 +0000</pubDate> <dc:creator>Robert Kern</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[Tables]]></category><guid
isPermaLink="false">http://www.robertkern.com/?p=145</guid> <description><![CDATA[I came across an article that described how to use PHP to make alternate coloured rows in a table and was surprised at how difficult they made it.  There is a very simple way to display alternate coloured rows in tabular data.  Read on for more info. Use the following PHP code to display alternate [...]]]></description> <content:encoded><![CDATA[<p>I came across an article that described how to use PHP to make alternate coloured rows in a table and was surprised at how difficult they made it.  There is a very simple way to display alternate coloured rows in tabular data.  Read on for more info.</p><p><span
id="more-145"></span></p><p>Use the following PHP code to display alternate rows in different colours.  What this is actually doing is setting the class for one row to: odd, and the next row to: even.  Then in my css stylesheet I will define .odd and .even to have different background colours.  I see this as a very clean and manageable way to do this common task.</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">//Set the index to zero</span>
<span style="color: #666666; font-style: italic;">//Put your code here to loop through the database result or whatever it is you are displaying</span>
<span style="color: #666666; font-style: italic;">//Then display the table row</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;tr class=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span><span style="color: #339933;">%</span><span style="color:#800080;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'odd'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'even'</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;</pre></div></div><p>This same idea can be used in probably all web development coding languages with slightly different syntax.</p> ]]></content:encoded> <wfw:commentRss>http://www.robertkern.com/php/use-php-to-make-alternate-coloured-rows.html/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Redirect to maintenance page</title><link>http://www.robertkern.com/hosting/redirect-to-maintenance-page.html</link> <comments>http://www.robertkern.com/hosting/redirect-to-maintenance-page.html#comments</comments> <pubDate>Tue, 29 Jul 2008 16:53:08 +0000</pubDate> <dc:creator>Robert Kern</dc:creator> <category><![CDATA[Hosting]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[mod_rewrite]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[server]]></category><guid
isPermaLink="false">http://www.robertkern.com/?p=109</guid> <description><![CDATA[I recently had to move a website to a new server.  While the DNS changes rolled over, I didnt want people to be able to access the site on the old server as I had already taken a backup and didnt want any more changes to be made. I used a .htaccess file to redirect [...]]]></description> <content:encoded><![CDATA[<p>I recently had to move a website to a new server.  While the DNS changes rolled over, I didnt want people to be able to access the site on the old server as I had already taken a backup and didnt want any more changes to be made.</p><p>I used a .htaccess file to redirect any request on the old site to a maintenance page:</p><p>RewriteEngine On<br
/> RewriteBase /<br
/> RewriteCond %{REQUEST_URI} !^/maintenance\.php$<br
/> RewriteRule ^(.*)$ /maintenance.php [R=307,L]</p><p>The above code redirects everything except the maintenance.php page to the maintenance.php page.</p><p>Its very useful to use scripts like this even when performing general maintenance on your site.  You could get even trickier by allowing your IP address to access the site while still blocking everyone else.  That way you can make sure your updates are working properly before &#8216;turning the site back on&#8217;.</p> ]]></content:encoded> <wfw:commentRss>http://www.robertkern.com/hosting/redirect-to-maintenance-page.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Finding objects close to a location with MySQL</title><link>http://www.robertkern.com/web-development/finding-objects-close-to-a-location-with-mysql.html</link> <comments>http://www.robertkern.com/web-development/finding-objects-close-to-a-location-with-mysql.html#comments</comments> <pubDate>Wed, 07 May 2008 01:38:10 +0000</pubDate> <dc:creator>Robert Kern</dc:creator> <category><![CDATA[How to]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[Google]]></category> <category><![CDATA[MySQL]]></category> <category><![CDATA[PHP]]></category><guid
isPermaLink="false">http://www.robertkern.com/?p=65</guid> <description><![CDATA[For a project I&#8217;m currently working on, I needed to be able to find people that a within a certain distance from a particular point. I have a large database of people that each have a Longitude and Latitude of their location. One of the searches in the app I am building needs to find [...]]]></description> <content:encoded><![CDATA[<p>For a project I&#8217;m currently working on, I needed to be able to find people that a within a certain distance from a particular point.</p><p>I have a large database of people that each have a Longitude and Latitude of their location.  One of the searches in the app I am building needs to find people that are close to the location of the Job.  So if the Job is in Kumeu (NZ), I want to see the people that are close (lets say 25km).</p><p>This is made easy with the <a
href="http://en.wikipedia.org/wiki/Haversine_formula" target="_blank">Haversine</a> formula.  Google has a <a
href="http://code.google.com/support/bin/answer.py?answer=87134&amp;topic=11364" target="_blank">good article</a> that gives a MySQL query that will produce a list of rows from the database where the locations are within a certain number of kilometres/miles.</p><p>The MySQL query looks like this:<br
/> <code><br
/> SELECT *,<br
/> (6371 *<br
/> acos(cos(radians(174.556107)) * cos(radians(latitude))<br
/> * cos(radians(longitude) - radians(-36.775700))<br
/> + sin(radians(174.556107)) * sin(radians(latitude))))<br
/> AS distance<br
/> FROM Locations<br
/> HAVING distance &lt; 25<br
/> ORDER BY distance<br
/> </code><br
/> The location in the example above (-36.775700, 174.556107) is of Kumeu (NZ).  The table currently has 4,500 records and the query takes about 0.0063 seconds (actually it is usually 0.0001 seconds).</p><p>Note that the above query calculates kilometres.  If you are wanting miles, change the figure of 6371 to 3959.</p><p>The HAVING distance &lt; 25 means that we are only getting the records who are within 25km of the original location.</p> ]]></content:encoded> <wfw:commentRss>http://www.robertkern.com/web-development/finding-objects-close-to-a-location-with-mysql.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>40 signs you really are a lousy PHP programmer</title><link>http://www.robertkern.com/php/40-signs-you-really-are-a-lousy-php-programmer.html</link> <comments>http://www.robertkern.com/php/40-signs-you-really-are-a-lousy-php-programmer.html#comments</comments> <pubDate>Sat, 12 Apr 2008 06:01:14 +0000</pubDate> <dc:creator>Robert Kern</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Programming]]></category><guid
isPermaLink="false">http://www.robertkern.com/?p=60</guid> <description><![CDATA[&#8220;This is something I prefer to call my &#8220;programming list of shame&#8220;. Although having a formal university education with courses on software engineering, enterprise software architecture &#38; database design I have been guilty of every single one of those things at one time or another. This is completely subjective &#38; Eclipse oriented.&#8221; Read article.]]></description> <content:encoded><![CDATA[<blockquote><p>&#8220;This is something I prefer to call my &#8220;<a
href="http://reinholdweber.com/?p=19" target="_blank">programming list of shame</a>&#8220;. Although having a formal university education with courses on software engineering, enterprise software architecture &amp; database design I have been guilty of every single one of those things at one time or another. This is completely subjective &amp; <a
href="http://www.eclipse.org/" target="_blank">Eclipse</a> oriented.&#8221; <a
href="http://reinholdweber.com/?p=19" target="_blank">Read article</a>.</p></blockquote> ]]></content:encoded> <wfw:commentRss>http://www.robertkern.com/php/40-signs-you-really-are-a-lousy-php-programmer.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Keep it simple, stupid</title><link>http://www.robertkern.com/php/keep-it-simple-stupid.html</link> <comments>http://www.robertkern.com/php/keep-it-simple-stupid.html#comments</comments> <pubDate>Sat, 12 Apr 2008 05:35:21 +0000</pubDate> <dc:creator>Robert Kern</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Programming]]></category><guid
isPermaLink="false">http://www.robertkern.com/?p=59</guid> <description><![CDATA[The KISS principle (acronym for &#8220;Keep It Simple, Stupid&#8221;) states that design simplicity should be a key goal and unnecessary complexity avoided. It serves as a useful principle in a wide array of disciplines, such as software development, animation, photography, engineering, and strategic planning. Common variants of the acronym include: &#8220;Keep It Sweet &#38; Simple&#8221;, [...]]]></description> <content:encoded><![CDATA[<p>The <a
href="http://en.wikipedia.org/wiki/KISS_principle" target="_blank">KISS principle</a> (acronym for &#8220;Keep It Simple, Stupid&#8221;) states that design simplicity should be a key goal and unnecessary complexity avoided. It serves as a useful principle in a wide array of disciplines, such as software development, animation, photography, engineering, and strategic planning. Common variants of the acronym include: &#8220;Keep It Sweet &amp; Simple&#8221;, and &#8220;Keep It Short &amp; Simple&#8221;. The form &#8220;Keep It Simple, Silly&#8221; is sometimes used in situations (for example, explaining the phrase to children) where &#8220;stupid&#8221; may be perceived as being too harsh.</p> ]]></content:encoded> <wfw:commentRss>http://www.robertkern.com/php/keep-it-simple-stupid.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Dont repeat yourself</title><link>http://www.robertkern.com/php/dont-repeat-yourself.html</link> <comments>http://www.robertkern.com/php/dont-repeat-yourself.html#comments</comments> <pubDate>Sat, 12 Apr 2008 05:31:57 +0000</pubDate> <dc:creator>Robert Kern</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Programming]]></category><guid
isPermaLink="false">http://www.robertkern.com/php/56.html</guid> <description><![CDATA[Don&#8217;t Repeat Yourself (DRY, also known as Single Point of Truth) is a process philosophy aimed at reducing duplication, particularly in computing. The philosophy emphasizes that information should not be duplicated, because duplication increases the difficulty of change, may decrease clarity, and leads to opportunities for inconsistency.]]></description> <content:encoded><![CDATA[<p><a
href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself" target="_blank">Don&#8217;t Repeat Yourself</a> (DRY, also known as Single Point of Truth) is a process philosophy aimed at reducing duplication, particularly in computing. The philosophy emphasizes that information should not be duplicated, because duplication increases the difficulty of change, may decrease clarity, and leads to opportunities for inconsistency.</p> ]]></content:encoded> <wfw:commentRss>http://www.robertkern.com/php/dont-repeat-yourself.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Ajax chat for PHP</title><link>http://www.robertkern.com/php/ajax-chat-for-php.html</link> <comments>http://www.robertkern.com/php/ajax-chat-for-php.html#comments</comments> <pubDate>Tue, 08 Jan 2008 01:07:54 +0000</pubDate> <dc:creator>Robert Kern</dc:creator> <category><![CDATA[PHP]]></category> <category><![CDATA[Ajax]]></category> <category><![CDATA[chat]]></category> <category><![CDATA[seo]]></category><guid
isPermaLink="false">http://www.robertkern.com/php/ajax-chat-for-php.html</guid> <description><![CDATA[One of my recent projects needed to have a chat facility built in that works between staff and clients. I wanted to build an Ajax chat system and thought rather than re-inventing the wheel, I would look for someone else&#8217;s solution to an Ajax based chat system. I came across this website by Cristian Darie. [...]]]></description> <content:encoded><![CDATA[<p>One of my <a
href="http://www.robertkern.com/projects/askchris-online-counselling-with-ajax-based-chat">recent projects</a> needed to have a chat facility built in that works between staff and clients.  I wanted to build an Ajax chat system and thought rather than re-inventing the wheel, I would look for someone else&#8217;s solution to an Ajax based chat system.  I came across <a
href="http://cristian.nexcess.net/ajax/chat/" target="_blank">this website</a> by <a
href="http://www.cristiandarie.ro/" target="_blank">Cristian Darie</a>.  I had read through some of Cristian&#8217;s scripts and articles in the past so I knew that he wrote quality code and made quality systems.  His book about <a
href="http://www.cristiandarie.ro/seo-php/" target="_blank">PHP and SEO</a> is well worth a read.</p><p>I found lots of other examples of Ajax based chat but most of them were dirty, buggy, and smelly.  So I heavily modified Cristian&#8217;s code to suit my needs and used it in the project.  Thanks Cristian!</p> ]]></content:encoded> <wfw:commentRss>http://www.robertkern.com/php/ajax-chat-for-php.html/feed</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>WHOIS lookups with PHP</title><link>http://www.robertkern.com/php/whois-lookups-with-php.html</link> <comments>http://www.robertkern.com/php/whois-lookups-with-php.html#comments</comments> <pubDate>Sun, 06 Jan 2008 00:02:31 +0000</pubDate> <dc:creator>Robert Kern</dc:creator> <category><![CDATA[How to]]></category> <category><![CDATA[PHP]]></category> <category><![CDATA[Web Development]]></category> <category><![CDATA[DNS]]></category> <category><![CDATA[whois]]></category><guid
isPermaLink="false">http://www.robertkern.com/dns/whois-lookups-with-php.html</guid> <description><![CDATA[I wanted to add WHOIS lookup capability to a recent project I was working on. I had never had a reason to implement a WHOIS lookup system before so I went in search of a simple system to lookup WHOIS records and then I would simply display the raw data. I came across quite a [...]]]></description> <content:encoded><![CDATA[<p>I wanted to add <a
href="http://en.wikipedia.org/wiki/WHOIS" target="_blank">WHOIS</a> lookup capability to a <a
href="http://www.robertkern.com/projects/web-developers-client-manager">recent project</a> I was working on.  I had never had a reason to implement a WHOIS lookup system before so I went in search of a simple system to lookup WHOIS records and then I would simply display the raw data.</p><p>I came across quite a few suggestions of scripts to do this, but I wanted to find something clean and logical.  I ended up with the following code after modifying an existing script to suit my needs:<br
/> <span
id="more-14"></span></p><p
class="postmetadata">Download file: <a
href="http://www.robertkern.com/wp-content/uploads/2008/01/whoisclass.zip">whois.class.zip</a></p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">class</span> Whois<span style="color: #009900;">&#123;</span>
&nbsp;
	    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$m_status</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
	    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$m_domain</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$m_servers</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$m_data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$m_connectiontimeout</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span>
	    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$m_sockettimeout</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">30</span><span style="color: #339933;">;</span>
	    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$m_redirectauth</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$m_usetlds</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$m_supportedtlds</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$m_serversettings</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   	    <span style="color: #000000; font-weight: bold;">function</span> Whois<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		    <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>readconfig<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
&nbsp;
	    <span style="color: #000000; font-weight: bold;">function</span> readconfig<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
		    <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_serversettings <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_tlds <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_usetlds <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$servers</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>	<span style="color: #0000ff;">&quot;whois.crsnic.net#domain |No match for |Whois Server:|&amp;gt;NOTICE: The expiration date |Registrar:#Status:#Expiration Date:&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;whois.afilias.net|NOT FOUND||
								&quot;</span>whois<span style="color: #339933;">.</span>nic<span style="color: #339933;">.</span>us<span style="color: #339933;">|</span>Not found<span style="color: #339933;">:||&amp;</span>gt<span style="color: #339933;">;</span>NeuStar<span style="color: #339933;">,</span> Inc<span style="color: #339933;">.,</span> the Registry Administrator<span style="color: #339933;">|</span>Domain Expiration <span style="color: #990000;">Date</span><span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">#Domain Status:#Sponsoring Registrar:#Registrant Name:#Registrant Email:#Administrative Contact Name:#Administrative Contact Email:#Billing Contact Name:#Billing Contact Email:#Technical Contact Name:#Technical Contact Email:#Name Server:&quot;,
</span>								<span style="color: #0000ff;">&quot;whois.internic.net|No match for |Whois Server:&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;whois.publicinterestregistry.net|NOT FOUND||
								&quot;</span>whois<span style="color: #339933;">.</span>neulevel<span style="color: #339933;">.</span>biz<span style="color: #339933;">|</span>Not found<span style="color: #339933;">:||&amp;</span>gt<span style="color: #339933;">;</span>NeuLevel<span style="color: #339933;">,</span> Inc<span style="color: #339933;">.,</span> the Registry<span style="color: #339933;">|</span>Domain Expiration <span style="color: #990000;">Date</span><span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">#Domain Status:#Sponsoring Registrar:#Registrant Name:#Registrant Email:#Administrative Contact Name:#Administrative Contact Email:#Billing Contact Name:#Billing Contact Email:#Technical Contact Name:#Technical Contact Email:#Name Server:&quot;,
</span>								<span style="color: #0000ff;">&quot;whois.nic.uk|No match for|||Registration Status:#Registrant:#Registrant's Address:#Renewal Date:#Name servers&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;rs.domainbank.net|||
								&quot;</span>whois<span style="color: #339933;">.</span>moniker<span style="color: #339933;">.</span>com<span style="color: #339933;">|||</span>
								<span style="color: #0000ff;">&quot;whois.networksolutions.com|||
								&quot;</span>whois<span style="color: #339933;">.</span>enom<span style="color: #339933;">.</span>com<span style="color: #339933;">|||&amp;</span>gt<span style="color: #339933;">;</span>The data in this whois database <span style="color: #339933;">|</span>Registrant Contact<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">#Technical Contact:#Billing Contact:#Administrative Contact:#Status:#Name Servers:#Expiration date:&quot;,
</span>								<span style="color: #0000ff;">&quot;whois.opensrs.net|||&amp;gt;The Data in the Tucows Registrar|Registrant:#Administrative Contact:#Technical Contact:#Record expires on#Domain servers in listed order:&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;whois.godaddy.com|||
								&quot;</span>whois<span style="color: #339933;">.</span>aunic<span style="color: #339933;">.</span>net<span style="color: #339933;">|</span>No Data Found<span style="color: #339933;">|||</span>Status<span style="color: #339933;">:</span><span style="color: #666666; font-style: italic;">#Registrant Contact Name:#Registrant Email:#Name Server:#Tech Name:#Tech Email:&quot;,
</span>								<span style="color: #0000ff;">&quot;whois.denic.de|free&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;whois.worldsite.ws|No match for|||Registrant:#Name Servers:&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;whois.nic.tv|&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;whois.nic.tm|No match for&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;whois.cira.ca|AVAIL&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;whois.nic.cc|No match|Whois Server:|&amp;gt;The Data in eNIC Corporation|Whois Server:#Updated:&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;whois.domainzoo.com|||
								&quot;</span>whois<span style="color: #339933;">.</span>domaindiscover<span style="color: #339933;">.</span>com<span style="color: #339933;">|||</span>
								<span style="color: #0000ff;">&quot;whois.markmonitor.com|||
								&quot;</span>whois2<span style="color: #339933;">.</span>afilias<span style="color: #339933;">-</span>grs<span style="color: #339933;">.</span>net<span style="color: #339933;">|</span>NOT FOUND<span style="color: #339933;">||</span>
								<span style="color: #0000ff;">'whois.srs.net.nz|'</span>
								<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$tlds</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>		<span style="color: #0000ff;">&quot;com=whois.crsnic.net&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;net=whois.crsnic.net&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;org=whois.publicinterestregistry.net&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;info=whois.afilias.net&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;biz=whois.neulevel.biz&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;us=whois.nic.us&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;co.uk=whois.nic.uk&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;org.uk=whois.nic.uk&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;ltd.uk=whois.nic.uk&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;ca=whois.cira.ca&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;cc=whois.nic.cc&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;edu=whois.crsnic.net&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;com.au=whois.aunic.net&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;net.au=whois.aunic.net&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;de=whois.denic.de&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;ws=whois.worldsite.ws&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">&quot;sc=whois2.afilias-grs.net&quot;</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">'co.nz=whois.srs.net.nz'</span><span style="color: #339933;">,</span>
								<span style="color: #0000ff;">'net.nz=whois.srs.net.nz'</span>
								<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
            <span style="color: #000088;">$cnt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$servers</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$servers</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$server</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			    <span style="color: #000088;">$server</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$server</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			    <span style="color: #000088;">$bits</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'|'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$server</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$bits</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				    <span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$bits</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&amp;</span>lt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
					    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$bits</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000088;">$bits</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
				    <span style="color: #009900;">&#125;</span>
				    <span style="color: #000088;">$server</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$bits</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$server</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000088;">$server</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
&nbsp;
				    <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_serversettings<span style="color: #009900;">&#91;</span><span style="color: #000088;">$server</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'server'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #000088;">$server</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'available'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #000088;">$bits</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'auth'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #000088;">$bits</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'clean'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #000088;">$bits</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'hilite'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #000088;">$bits</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'extra'</span><span style="color: #339933;">=&amp;</span>gt<span style="color: #339933;">;</span><span style="color: #000088;">$server</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			    <span style="color: #009900;">&#125;</span>
		    <span style="color: #009900;">&#125;</span>
		    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$tlds</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$tld</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			    <span style="color: #000088;">$tld</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tld</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			    <span style="color: #000088;">$bits</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'='</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tld</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$bits</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">2</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000088;">$bits</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_serversettings<span style="color: #009900;">&#91;</span><span style="color: #000088;">$bits</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				    <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_usetlds<span style="color: #009900;">&#91;</span><span style="color: #000088;">$bits</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
				    <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_tlds<span style="color: #009900;">&#91;</span><span style="color: #000088;">$bits</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$bits</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			    <span style="color: #009900;">&#125;</span>
		    <span style="color: #009900;">&#125;</span>
&nbsp;
	    <span style="color: #009900;">&#125;</span>
&nbsp;
	    <span style="color: #000000; font-weight: bold;">function</span> SetTlds<span style="color: #009900;">&#40;</span><span style="color: #000088;">$tlds</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'com,net,org,info,biz,us,co.uk,org.uk,co.nz'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		    <span style="color: #000088;">$tlds</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$tlds</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #000088;">$tlds</span> <span style="color: #339933;">=</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span><span style="color: #000088;">$tlds</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_usetlds <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$tlds</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$t</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			    <span style="color: #000088;">$t</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$t</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_tlds<span style="color: #009900;">&#91;</span><span style="color: #000088;">$t</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_usetlds<span style="color: #009900;">&#91;</span><span style="color: #000088;">$t</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
		    <span style="color: #009900;">&#125;</span>
		    <span style="color: #b1b100;">return</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_usetlds<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
&nbsp;
	    <span style="color: #000000; font-weight: bold;">function</span> Lookup<span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		    <span style="color: #000088;">$domain</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_servers <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_data <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_tld <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_sld <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
		    <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_domain <span style="color: #339933;">=</span> <span style="color: #000088;">$domain</span><span style="color: #339933;">;</span>
		    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>splitdomain<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_domain<span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_sld<span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_tld<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			    <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_servers<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_tlds<span style="color: #009900;">&#91;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_tld<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			    <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_data<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>dolookup<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_serversettings<span style="color: #009900;">&#91;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_servers<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'extra'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #000088;">$domain</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_servers<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_data<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_serversettings<span style="color: #009900;">&#91;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_servers<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'auth'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_redirectauth <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_status <span style="color: #339933;">==</span> STATUS_UNAVAILABLE<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
					    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">preg_match</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_serversettings<span style="color: #009900;">&#91;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_servers<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'auth'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'(.*)/i'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_data<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$match</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
						    <span style="color: #000088;">$server</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$match</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$server</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
							    <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_servers<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$server</span><span style="color: #339933;">;</span>
							    <span style="color: #000088;">$command</span> <span style="color: #339933;">=</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_serversettings<span style="color: #009900;">&#91;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_servers<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'extra'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_serversettings<span style="color: #009900;">&#91;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_servers<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'extra'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
							    <span style="color: #000088;">$dt</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>dolookup<span style="color: #009900;">&#40;</span><span style="color: #000088;">$command</span><span style="color: #339933;">.</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_domain<span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_servers<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
							    <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_data<span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dt</span><span style="color: #339933;">;</span>
						    <span style="color: #009900;">&#125;</span>
					    <span style="color: #009900;">&#125;</span>
				    <span style="color: #009900;">&#125;</span>
				    <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
			    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
				    <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
			    <span style="color: #009900;">&#125;</span>
		    <span style="color: #009900;">&#125;</span>
		    <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
&nbsp;
	    <span style="color: #000000; font-weight: bold;">function</span> ValidDomain<span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		    <span style="color: #000088;">$domain</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>splitdomain<span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sld</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tld</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
&nbsp;
	    <span style="color: #000000; font-weight: bold;">function</span> GetDomain<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_domain<span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
&nbsp;
	    <span style="color: #000000; font-weight: bold;">function</span> GetServer<span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		    <span style="color: #b1b100;">return</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_servers<span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_servers<span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
&nbsp;
	    <span style="color: #000000; font-weight: bold;">function</span> GetData<span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_data<span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			    <span style="color: #000088;">$dt</span> <span style="color: #339933;">=</span> <span style="color: #990000;">htmlspecialchars</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_data<span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			    <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>cleandata<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_servers<span style="color: #009900;">&#91;</span><span style="color: #000088;">$i</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dt</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$dt</span><span style="color: #339933;">;</span>
		    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
			    <span style="color: #b1b100;">return</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">join</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_data<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #009900;">&#125;</span>
		    <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
&nbsp;
	    <span style="color: #000000; font-weight: bold;">function</span> splitdomain<span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span><span style="color: #000088;">$sld</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span><span style="color: #000088;">$tld</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		    <span style="color: #000088;">$domain</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #000088;">$sld</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$tld</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
		    <span style="color: #000088;">$domain</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #000088;">$pos</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'.'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$pos</span> <span style="color: #339933;">!=</span> <span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			    <span style="color: #000088;">$sld</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pos</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			    <span style="color: #000088;">$tld</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pos</span><span style="color: #339933;">+</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_usetlds<span style="color: #009900;">&#91;</span><span style="color: #000088;">$tld</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #000088;">$sld</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">true</span><span style="color: #339933;">;</span>
		    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
			    <span style="color: #000088;">$tld</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$domain</span><span style="color: #339933;">;</span>
		    <span style="color: #009900;">&#125;</span>
		    <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
&nbsp;
	    <span style="color: #000000; font-weight: bold;">function</span> whatserver<span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		    <span style="color: #000088;">$sld</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$tld</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
		    <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>splitdomain<span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #339933;">,</span> <span style="color: #000088;">$sld</span><span style="color: #339933;">,</span> <span style="color: #000088;">$tld</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #000088;">$server</span> <span style="color: #339933;">=</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_usetlds<span style="color: #009900;">&#91;</span><span style="color: #000088;">$tld</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_tlds<span style="color: #009900;">&#91;</span><span style="color: #000088;">$tld</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
		    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$server</span><span style="color: #339933;">;</span>
	    <span style="color: #009900;">&#125;</span>
&nbsp;
	    <span style="color: #000000; font-weight: bold;">function</span> dolookup<span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #339933;">,</span> <span style="color: #000088;">$server</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		    <span style="color: #000088;">$domain</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$domain</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #000088;">$server</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$server</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$domain</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">''</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$server</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
		    <span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
		    <span style="color: #000088;">$fp</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">fsockopen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$server</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">43</span><span style="color: #339933;">,</span><span style="color: #000088;">$errno</span><span style="color: #339933;">,</span> <span style="color: #000088;">$errstr</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_connectiontimeout<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$fp</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			    <span style="color: #339933;">@</span><span style="color: #990000;">fputs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #339933;">,</span> <span style="color: #000088;">$domain</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			    <span style="color: #339933;">@</span><span style="color: #990000;">socket_set_timeout</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_sockettimeout<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			    <span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!@</span><span style="color: #990000;">feof</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				    <span style="color: #000088;">$data</span> <span style="color: #339933;">.=</span> <span style="color: #339933;">@</span><span style="color: #990000;">fread</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4096</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			    <span style="color: #009900;">&#125;</span>
			    <span style="color: #339933;">@</span><span style="color: #990000;">fclose</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fp</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$data</span><span style="color: #339933;">;</span>
		    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
			    <span style="color: #b1b100;">return</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>Error - could not open a connection to <span style="color: #006699; font-weight: bold;">$server</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
		    <span style="color: #009900;">&#125;</span>
	    <span style="color: #009900;">&#125;</span>
&nbsp;
	    <span style="color: #000000; font-weight: bold;">function</span> cleandata<span style="color: #009900;">&#40;</span><span style="color: #000088;">$server</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_serversettings<span style="color: #009900;">&#91;</span><span style="color: #000088;">$server</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
			    <span style="color: #000088;">$clean</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>m_serversettings<span style="color: #009900;">&#91;</span><span style="color: #000088;">$server</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'clean'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
			    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$clean</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">''</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
				    <span style="color: #000088;">$from</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$clean</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$from</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'&amp;gt;'</span> <span style="color: #339933;">||</span> <span style="color: #000088;">$from</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'&amp;lt;'</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
					    <span style="color: #000088;">$clean</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$clean</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					    <span style="color: #000088;">$pos</span> <span style="color: #339933;">=</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #990000;">strtolower</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$clean</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
					    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$pos</span> <span style="color: #339933;">!==</span> <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
						    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$from</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'&amp;gt;'</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
							    <span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pos</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
							    <span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span><span style="color: #339933;">,</span> <span style="color: #000088;">$pos</span><span style="color: #339933;">+</span><span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$clean</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
						    <span style="color: #009900;">&#125;</span>
					    <span style="color: #009900;">&#125;</span>
				    <span style="color: #009900;">&#125;</span>
			    <span style="color: #009900;">&#125;</span>
		    <span style="color: #009900;">&#125;</span>
	    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
?<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span></pre></div></div>]]></content:encoded> <wfw:commentRss>http://www.robertkern.com/php/whois-lookups-with-php.html/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: www.robertkern.com @ 2012-02-06 23:57:01 -->
