<?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>HM2K.com &#187; PHP</title>
	<atom:link href="http://www.hm2k.com/posts/category/dev/php/feed" rel="self" type="application/rss+xml" />
	<link>http://www.hm2k.com</link>
	<description>The research of an internet entrepreneur and IT consultant</description>
	<lastBuildDate>Wed, 30 Jun 2010 09:29:14 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Getting started with Quercus in Google App Engine</title>
		<link>http://www.hm2k.com/posts/getting-started-with-quercus-in-google-app-engine</link>
		<comments>http://www.hm2k.com/posts/getting-started-with-quercus-in-google-app-engine#comments</comments>
		<pubDate>Thu, 15 Apr 2010 12:26:55 +0000</pubDate>
		<dc:creator>hm2k</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[gae]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[google app engine]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[quercus]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.hm2k.com/?p=609</guid>
		<description><![CDATA[Last year an article was written on a blog about how to run PHP on Google App Engine (GAE).
The guide came with a pre-made package to get you started.
However, Quercus has been updated since this was produced.
Unfortunately the official Quercus website has very little detail to help us get started&#8230;
Further research lead me to a [...]


Related posts:<ol><li><a href='http://www.hm2k.com/posts/10-wordpress-performance-optimisation-tips' rel='bookmark' title='Permanent Link: 10 wordpress performance optimisation tips'>10 wordpress performance optimisation tips</a> <small>I wanted to prepare my wordpress powered blog for an...</small></li>
<li><a href='http://www.hm2k.com/posts/using-your-own-url-as-your-openid-with-wordpress' rel='bookmark' title='Permanent Link: Using Your Own URL as Your OpenID with WordPress'>Using Your Own URL as Your OpenID with WordPress</a> <small>Today I decided to join stackoverflow.com, which requires you to...</small></li>
<li><a href='http://www.hm2k.com/posts/the-google-translate-recursion-bug' rel='bookmark' title='Permanent Link: The Google Translate recursion bug'>The Google Translate recursion bug</a> <small>Recently I found a bug in Google Translate. It&#8217;s not...</small></li>
<li><a href='http://www.hm2k.com/posts/cannot-redeclare-pclziputilpathreduction' rel='bookmark' title='Permanent Link: Cannot redeclare pclziputilpathreduction()'>Cannot redeclare pclziputilpathreduction()</a> <small>I had this issue today, I found that you need...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Last year an article was written on a blog about how to <a href="http://www.webdigi.co.uk/blog/2009/run-php-on-the-google-app-engine/">run PHP on Google App Engine (GAE)</a>.</p>
<p>The guide came with a pre-made package to get you started.</p>
<p>However, Quercus has been updated since this was produced.</p>
<p><span id="more-609"></span>Unfortunately the <a href="http://quercus.caucho.com/">official Quercus website</a> has very little detail to help us get started&#8230;</p>
<p>Further research lead me to a blog post by the company that makes Quercus entitled: <a href="http://blog.caucho.com/?p=187">Quercus on the Google App Engine</a></p>
<p>It gives a general overview of what is required, but isn&#8217;t really very direct.</p>
<p>I did also find an entry on their wiki for <a href="http://wiki.caucho.com/Quercus_Google_App_Engine">Quercus on Google App Engine</a>, which was more useful.</p>
<p>Here&#8217;s what you need to do:</p>
<ol>
<li>Follow the <a href="http://code.google.com/appengine/docs/java/gettingstarted/creating.html">Google App Engine: Creating a Project getting started guide</a> to create your file structure and the xml files.</li>
<li> Download the <a href="http://caucho.com/download">latest version of Resin</a> (ie: <a href="http://www.caucho.com/download/resin-4.0.6.zip">resin-4.0.6.zip</a>)</li>
<li>From the zip, copy lib/resin.jar to your WEB-INF/lib</li>
<li>Add GoogleQuercusServlet as a standard servlet and any params to web.xml (<a href="http://gist.github.com/367023">example web.xml</a>)</li>
<li>Put your PHP files in your &#8220;war&#8221; directory.</li>
<li>Use the <a href="http://code.google.com/appengine/downloads.html#Google_App_Engine_SDK_for_Java">AppEngine Java SDK</a> appcfg to update.</li>
</ol>
<p>If you get this error:</p>
<blockquote><p>java.lang.IllegalStateException: Found a jar file too large to upload: &#8220;&#8230;\WEB-INF\lib\resin.jar&#8221;.  Consider using &#8211;enable_jar_splitting.</p></blockquote>
<p>Using the suggested option fixed this, which looks like this:</p>
<blockquote><p>C:\appengine-java-sdk\bin\appcfg.cmd &#8211;enable_jar_splitting update war</p></blockquote>
<p>That&#8217;s pretty much it to get you started, when you visit your app address, you should be able to call your PHP files.</p>
<p>If you are looking for something a bit more advanced, take a look at these articles that explain how to get WordPress working:</p>
<ul>
<li><a href="http://blog.caucho.com/?p=196">Converting Wordpress for Quercus on Google App Engine</a></li>
<li><a href="http://www.caucho.com/articles/Quercus_on_GAE.pdf">Using Quercus® to Run the WordPress PHP blog on Google App Engine (pdf)</a></li>
</ul>
<p>For additional help I recommend you visit <a href="http://forum.caucho.com/forumdisplay.php?f=5">Caucho&#8217;s Quercus  Forums</a>.</p>
<div id="_mcePaste" style="position: absolute; left: -10000px; top: 575px; width: 1px; height: 1px; overflow: hidden;">Using Quercus® to Run the WordPress PHP blog on Google App EngineUsing Quercus® to Run the WordPress PHP blog on Google App Engine</div>


<p>Related posts:<ol><li><a href='http://www.hm2k.com/posts/10-wordpress-performance-optimisation-tips' rel='bookmark' title='Permanent Link: 10 wordpress performance optimisation tips'>10 wordpress performance optimisation tips</a> <small>I wanted to prepare my wordpress powered blog for an...</small></li>
<li><a href='http://www.hm2k.com/posts/using-your-own-url-as-your-openid-with-wordpress' rel='bookmark' title='Permanent Link: Using Your Own URL as Your OpenID with WordPress'>Using Your Own URL as Your OpenID with WordPress</a> <small>Today I decided to join stackoverflow.com, which requires you to...</small></li>
<li><a href='http://www.hm2k.com/posts/the-google-translate-recursion-bug' rel='bookmark' title='Permanent Link: The Google Translate recursion bug'>The Google Translate recursion bug</a> <small>Recently I found a bug in Google Translate. It&#8217;s not...</small></li>
<li><a href='http://www.hm2k.com/posts/cannot-redeclare-pclziputilpathreduction' rel='bookmark' title='Permanent Link: Cannot redeclare pclziputilpathreduction()'>Cannot redeclare pclziputilpathreduction()</a> <small>I had this issue today, I found that you need...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hm2k.com/posts/getting-started-with-quercus-in-google-app-engine/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to convert an image to greyscale using PHP</title>
		<link>http://www.hm2k.com/posts/how-to-convert-an-image-to-greyscale-using-php</link>
		<comments>http://www.hm2k.com/posts/how-to-convert-an-image-to-greyscale-using-php#comments</comments>
		<pubDate>Thu, 10 Dec 2009 14:39:30 +0000</pubDate>
		<dc:creator>hm2k</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[conver]]></category>
		<category><![CDATA[convert]]></category>
		<category><![CDATA[gray]]></category>
		<category><![CDATA[grayscale]]></category>
		<category><![CDATA[grey]]></category>
		<category><![CDATA[greyscale]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[imagefilter]]></category>
		<category><![CDATA[IMG_FILTER_GRAYSCALE]]></category>

		<guid isPermaLink="false">http://www.hm2k.com/?p=583</guid>
		<description><![CDATA[I was trying to find a neat way to grey out some &#8220;powered by&#8221; logos for a website I&#8217;m developing.
I remembered reading about this very thing in .net magazine/august 2009 (i191,p100), which said:
&#8220;Sponsor and associate logos can be a challenge for a designer who is making a valiant attempt to create a cohesive website layout. [...]


Related posts:<ol><li><a href='http://www.hm2k.com/posts/mounting-an-iso-image' rel='bookmark' title='Permanent Link: Mounting an ISO image'>Mounting an ISO image</a> <small>An ISO image usually refers to an archived copy of...</small></li>
<li><a href='http://www.hm2k.com/posts/how-to-bulk-convert-wma-to-mp3' rel='bookmark' title='Permanent Link: How to bulk convert WMA to MP3'>How to bulk convert WMA to MP3</a> <small>So you just downloaded an entire album, and it&#8217;s in...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I was trying to find a neat way to grey out some &#8220;powered by&#8221; logos for a website I&#8217;m developing.</p>
<p>I remembered reading about this very thing in <a href="http://en.wikipedia.org/wiki/.net_%28magazine%29">.net magazine</a>/<a href="http://www.badassideas.com/downloads/net191swarren.pdf">august 2009 (i191,p100)</a>, which said:</p>
<blockquote><p><em>&#8220;Sponsor and associate logos can be a challenge for a designer who is making a valiant attempt to create a cohesive website layout. Logos can be contrasting colour schemes and can be displayed at a wide range of different aspect ratios. When faced with this challenge, I recommend greying out the logos and having them appear in their respective colours upon mouse-over. When placing logos next to each other, I’d consider using visual weight versus actual size to determine spacing.&#8221;</em></p>
<p>- <a href="http://badassideas.com/">Samantha Warren @ badassideas.com</a></p></blockquote>
<p>So, sure we&#8217;ve established that it&#8217;s a good idea, the question is how to achieve it&#8230;</p>
<p><span id="more-583"></span>It&#8217;s really quite simple, there&#8217;s two parts:</p>
<ol>
<li>Convert the image to greyscale using PHP.</li>
<li>Write HTML and javascript that will change the image source on mouseover.</li>
</ol>
<p>Before I get started, I need to point out that because I&#8217;m British, I use &#8220;Grey&#8221;, instead of the American &#8220;Gray&#8221;, apart from in the actual code.</p>
<p>I very quickly discovered a number of ways to convert an image from colour to greyscale, however the easiest way appeared to be using the <a href="http://php.net/manual/en/function.imagefilter.php">imagefilter()</a> function with the IMG_FILTER_GRAYSCALE greyscale filter which produced the results I was looking for. I found you can also very <a href="http://www.talkincode.com/add-effects-to-images-using-image-filters-with-php-266.html">easily add all sorts of effects to images using PHP</a>.</p>
<p>I kept it simple and wrote a function that would convert an image from jpeg, gif or png to a png greyscale image. I called it <a href="http://hm2k.googlecode.com/svn/trunk/code/php/functions/imagegray.php">imagegray()</a>.</p>
<p>It&#8217;s very easy to use, you just pass the filename to the function and it will display the image in greyscale. For example:</p>
<blockquote><p>&lt;?php</p>
<p>$i=isset($_REQUEST['i'])?$_REQUEST['i']:&#8221;;<br />
if ($i) { imagegrey($i); }</p>
<p>?&gt;</p></blockquote>
<p>Next, it&#8217;s onto the HTML, which although isn&#8217;t exactly difficult, you may stumble if you&#8217;re unsure&#8230;</p>
<blockquote><p>&lt;img onmouseover=&#8221;this.src=&#8217;image.jpg&#8217;&#8221; onmouseout=&#8221;this.src=&#8217;imagegrey.php?i=image.jpg&#8217;&#8221; src=&#8221;imagegrey.php?i=image.jpg&#8221; alt=&#8221;image&#8221; border=&#8221;0&#8243;&gt;</p></blockquote>
<p>That&#8217;s it, that&#8217;s all there is to it.</p>
<p>If you run a large site, for scalability reasons you may wish to involve caching, but for most small sites, this method is quick and effective.</p>
<p>Enjoy!</p>


<p>Related posts:<ol><li><a href='http://www.hm2k.com/posts/mounting-an-iso-image' rel='bookmark' title='Permanent Link: Mounting an ISO image'>Mounting an ISO image</a> <small>An ISO image usually refers to an archived copy of...</small></li>
<li><a href='http://www.hm2k.com/posts/how-to-bulk-convert-wma-to-mp3' rel='bookmark' title='Permanent Link: How to bulk convert WMA to MP3'>How to bulk convert WMA to MP3</a> <small>So you just downloaded an entire album, and it&#8217;s in...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hm2k.com/posts/how-to-convert-an-image-to-greyscale-using-php/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How not to use PHPMailer</title>
		<link>http://www.hm2k.com/posts/how-not-to-use-phpmailer</link>
		<comments>http://www.hm2k.com/posts/how-not-to-use-phpmailer#comments</comments>
		<pubDate>Mon, 24 Aug 2009 12:14:13 +0000</pubDate>
		<dc:creator>hm2k</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[PHPMailer]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sourcingmap]]></category>

		<guid isPermaLink="false">http://www.hm2k.com/?p=476</guid>
		<description><![CDATA[I came across PHPMailer usage the other day on a Chinese gadget wholesale site &#8220;SourcingMap.com&#8221;.
If you submit something via their contact us form, interestingly you appear to get a dump from PHP telling you all about the PHPMailer object.
The output looks something like this:
object(PHPMailer)#15 (41) {   ["Priority"]=&#62;   int(3)   ["CharSet"]=&#62; [...]


Related posts:<ol><li><a href='http://www.hm2k.com/posts/gmail-needs-an-api' rel='bookmark' title='Permanent Link: Gmail needs an API'>Gmail needs an API</a> <small>Yesterday I spent some time investigating Google Wave. A very...</small></li>
<li><a href='http://www.hm2k.com/posts/tracking-an-ip-address' rel='bookmark' title='Permanent Link: Tracking an IP address'>Tracking an IP address</a> <small>In my job I have to manage lots of machines...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I came across <a href="http://phpmailer.worxware.com/">PHPMailer</a> usage the other day on a Chinese gadget wholesale site &#8220;SourcingMap.com&#8221;.</p>
<p>If you submit something via their <a href="http://www.sourcingmap.com/contact_us.php">contact us</a> form, interestingly you appear to get a dump from PHP telling you all about the PHPMailer object.</p>
<p><span id="more-476"></span>The output looks something like this:</p>
<blockquote><p>object(PHPMailer)#15 (41) {   ["Priority"]=&gt;   int(3)   ["CharSet"]=&gt;   string(10) &#8220;iso-8859-1&#8243;   ["ContentType"]=&gt;   string(9) &#8220;text/html&#8221;   ["Encoding"]=&gt;   string(4) &#8220;8bit&#8221;   ["ErrorInfo"]=&gt;   string(0) &#8220;&#8221;   ["From"]=&gt;   string(16) &#8220;test@example.com&#8221;   ["FromName"]=&gt;   string(11) &#8220;Sourcingmap&#8221;   ["Sender"]=&gt;   string(0) &#8220;&#8221;   ["Subject"]=&gt;   string(26) &#8220;Enquiry From  Sourcingmap.&#8221;   ["Body"]=&gt;   string(7) &#8220;Testing&#8221;   ["AltBody"]=&gt;   string(0) &#8220;&#8221;   ["WordWrap"]=&gt;   int(0)   ["Mailer"]=&gt;   string(4) &#8220;smtp&#8221;   ["Sendmail"]=&gt;   string(18) &#8220;/usr/sbin/sendmail&#8221;   ["PluginDir"]=&gt;   string(0) &#8220;&#8221;   ["Version"]=&gt;   string(9) &#8220;2.0.0 rc3&#8243;   ["ConfirmReadingTo"]=&gt;   string(0) &#8220;&#8221;   ["Hostname"]=&gt;   string(0) &#8220;&#8221;   ["Host"]=&gt;   string(14) &#8220;smtp.gmail.com&#8221;   ["Port"]=&gt;   int(465)   ["Helo"]=&gt;   string(0) &#8220;&#8221;   ["SMTPSecure"]=&gt;   string(3) &#8220;ssl&#8221;   ["SMTPAuth"]=&gt;   bool(true)   ["Username"]=&gt;   string(22) &#8220;orders@sourcingmap.com&#8221;   ["Password"]=&gt;   string(16) &#8220;ilovesourcingmap&#8221;   ["Timeout"]=&gt;   int(10)   ["SMTPDebug"]=&gt;   bool(false)   ["SMTPKeepAlive"]=&gt;   bool(false)   ["SingleTo"]=&gt;   bool(false)   ["smtp"]=&gt;   NULL   ["to"]=&gt;   array(1) {     [0]=&gt;     array(2) {       [0]=&gt;       string(20) &#8220;info@sourcingmap.com&#8221;       [1]=&gt;       string(11) &#8220;SourcingMap&#8221;     }   }   ["cc"]=&gt;   array(0) {   }   ["bcc"]=&gt;   array(0) {   }   ["ReplyTo"]=&gt;   array(1) {     [0]=&gt;     array(2) {       [0]=&gt;       string(16) &#8220;test@example.com&#8221;       [1]=&gt;       string(7) &#8220;My Name&#8221;     }   }   ["attachment"]=&gt;   array(0) {   }   ["CustomHeader"]=&gt;   array(0) {   }   ["message_type"]=&gt;   string(0) &#8220;&#8221;   ["boundary"]=&gt;   array(0) {   }   ["language"]=&gt;   array(0) {   }   ["error_count"]=&gt;   int(0)   ["LE"]=&gt;   string(1) &#8221; &#8221; }</p></blockquote>
<p>After taking a look at the source code, I found that it&#8217;s simply an &#8220;AJAX&#8221; call to a script called &#8220;<a href="http://www.sourcingmap.com/mail_in_pop.php">mail_in_pop.php</a>&#8220;.</p>
<p>The best thing about this whole issue is the fact that their password for their mailbox appears in plain text and would be easy to guess. I&#8217;m guessing this isn&#8217;t the only place they use this password.</p>
<p>Yet another PHP fail whale.</p>
<p>I&#8217;m available for hire if you want me to fix this.</p>
<p>Enjoy!</p>
<p>PS. I do actually like SourcingMap but there&#8217;s no excuse for this kind of blatantly poor security.</p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">object(PHPMailer)#15 (41) {   ["Priority"]=&gt;   int(3)   ["CharSet"]=&gt;   string(10) &#8220;iso-8859-1&#8243;   ["ContentType"]=&gt;   string(9) &#8220;text/html&#8221;   ["Encoding"]=&gt;   string(4) &#8220;8bit&#8221;   ["ErrorInfo"]=&gt;   string(0) &#8220;&#8221;   ["From"]=&gt;   string(16) &#8220;test@example.com&#8221;   ["FromName"]=&gt;   string(11) &#8220;Sourcingmap&#8221;   ["Sender"]=&gt;   string(0) &#8220;&#8221;   ["Subject"]=&gt;   string(26) &#8220;Enquiry From  Sourcingmap.&#8221;   ["Body"]=&gt;   string(7) &#8220;Testing&#8221;   ["AltBody"]=&gt;   string(0) &#8220;&#8221;   ["WordWrap"]=&gt;   int(0)   ["Mailer"]=&gt;   string(4) &#8220;smtp&#8221;   ["Sendmail"]=&gt;   string(18) &#8220;/usr/sbin/sendmail&#8221;   ["PluginDir"]=&gt;   string(0) &#8220;&#8221;   ["Version"]=&gt;   string(9) &#8220;2.0.0 rc3&#8243;   ["ConfirmReadingTo"]=&gt;   string(0) &#8220;&#8221;   ["Hostname"]=&gt;   string(0) &#8220;&#8221;   ["Host"]=&gt;   string(14) &#8220;smtp.gmail.com&#8221;   ["Port"]=&gt;   int(465)   ["Helo"]=&gt;   string(0) &#8220;&#8221;   ["SMTPSecure"]=&gt;   string(3) &#8220;ssl&#8221;   ["SMTPAuth"]=&gt;   bool(true)   ["Username"]=&gt;   string(22) &#8220;orders@sourcingmap.com&#8221;   ["Password"]=&gt;   string(16) &#8220;ilovesourcingmap&#8221;   ["Timeout"]=&gt;   int(10)   ["SMTPDebug"]=&gt;   bool(false)   ["SMTPKeepAlive"]=&gt;   bool(false)   ["SingleTo"]=&gt;   bool(false)   ["smtp"]=&gt;   NULL   ["to"]=&gt;   array(1) {     [0]=&gt;     array(2) {       [0]=&gt;       string(20) &#8220;info@sourcingmap.com&#8221;       [1]=&gt;       string(11) &#8220;SourcingMap&#8221;     }   }   ["cc"]=&gt;   array(0) {   }   ["bcc"]=&gt;   array(0) {   }   ["ReplyTo"]=&gt;   array(1) {     [0]=&gt;     array(2) {       [0]=&gt;       string(16) &#8220;test@example.com&#8221;       [1]=&gt;       string(7) &#8220;My Name&#8221;     }   }   ["attachment"]=&gt;   array(0) {   }   ["CustomHeader"]=&gt;   array(0) {   }   ["message_type"]=&gt;   string(0) &#8220;&#8221;   ["boundary"]=&gt;   array(0) {   }   ["language"]=&gt;   array(0) {   }   ["error_count"]=&gt;   int(0)   ["LE"]=&gt;   string(1) &#8221; &#8221; } <strong><span style="color: red;">Your enquiry has been successfully sent to the Store Owner.</span></strong></div>


<p>Related posts:<ol><li><a href='http://www.hm2k.com/posts/gmail-needs-an-api' rel='bookmark' title='Permanent Link: Gmail needs an API'>Gmail needs an API</a> <small>Yesterday I spent some time investigating Google Wave. A very...</small></li>
<li><a href='http://www.hm2k.com/posts/tracking-an-ip-address' rel='bookmark' title='Permanent Link: Tracking an IP address'>Tracking an IP address</a> <small>In my job I have to manage lots of machines...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hm2k.com/posts/how-not-to-use-phpmailer/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cex.co.uk site errors</title>
		<link>http://www.hm2k.com/posts/cex-co-uk-site-errors</link>
		<comments>http://www.hm2k.com/posts/cex-co-uk-site-errors#comments</comments>
		<pubDate>Fri, 14 Aug 2009 08:29:24 +0000</pubDate>
		<dc:creator>hm2k</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[cex]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.hm2k.com/?p=450</guid>
		<description><![CDATA[After browsing the cex.co.uk website for some time I came across a few errors on the site&#8230;
The first one was when I visited this page a few months back&#8230;
PHP Warning:  imagejpeg() [&#60;a href='function.imagejpeg'&#62;function.imagejpeg&#60;/a&#62;]: Unable to open &#8216;c:\Inetpub\wwwroot\images\products\gaming\\5017783016963.jpg&#8217; for writing: No such file or directory in D:\websites\ukwwwroot\includes\functions\functions.inc.php on line 580
I also came across a couple of [...]


Related posts:<ol><li><a href='http://www.hm2k.com/posts/phpizabi-creating-a-dating-site' rel='bookmark' title='Permanent Link: PHPizabi &#8211; creating a dating site'>PHPizabi &#8211; creating a dating site</a> <small>During the summer of 2007 I decided to purchase a...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>After browsing the <a href="http://www.cex.co.uk/">cex.co.uk</a> website for some time I came across a few errors on the site&#8230;</p>
<p><span id="more-450"></span>The first one was when I visited <a href="http://www.cex.co.uk/products/Gaming/PC%20Gaming/PC%20CD-ROM/index.php?sku=5017783016963">this page</a> a few months back&#8230;</p>
<blockquote><p>PHP Warning:  imagejpeg() [&lt;a href='function.imagejpeg'&gt;function.imagejpeg&lt;/a&gt;]: Unable to open &#8216;c:\Inetpub\wwwroot\images\products\gaming\\5017783016963.jpg&#8217; for writing: No such file or directory in D:\websites\ukwwwroot\includes\functions\functions.inc.php on line 580</p></blockquote>
<p>I also came across a couple of other errors reported by other users on their very own forum&#8230;</p>
<blockquote><p>PHP Warning: include(include/templates/side_r_uncached.php) [function.include]: failed to open stream: No such file or directory in D:\websites\ukwwwroot\sell\order_monitor_complete.php on line 188<br />
PHP Warning: include() [function.include]: Failed opening &#8216;include/templates/side_r_uncached.php&#8217; for inclusion (include_path=&#8217;C:\PHP\pear;d:\websites\ukwwwroot&#8217;) in D:\websites\ukwwwroot\sell\order_monitor_complete.php on line 188</p>
<p>PHP Warning: include(include/templates/side_r_uncached.php) [function.include]: failed to open stream: No such file or directory in D:\websites\ukwwwroot\sell\order_monitor_complete.php on line 188<br />
PHP Warning: include() [function.include]: Failed opening &#8216;include/templates/side_r_uncached.php&#8217; for inclusion (include_path=&#8217;C:\php528nts\pear;d:\websites\ukwwwroot&#8217;) in D:\websites\ukwwwroot\sell\order_monitor_complete.php on line 188</p></blockquote>
<p>I&#8217;m not sure whether these errors really give too much away, but they are still a security risk by releasing information that you don&#8217;t want us to know.</p>
<p>Such as that you&#8217;re using Windows to serve your site and the paths you&#8217;re including from.</p>
<p><strong>Security Experts:</strong> I&#8217;m not seeing any obvious vulnerabilities, are you?</p>
<p><strong>Cex:</strong> I&#8217;m available for consultancy and can fix these errors for you.</p>
<p>Let&#8217;s see who gets there first&#8230;</p>
<p>Times are hard hey?</p>


<p>Related posts:<ol><li><a href='http://www.hm2k.com/posts/phpizabi-creating-a-dating-site' rel='bookmark' title='Permanent Link: PHPizabi &#8211; creating a dating site'>PHPizabi &#8211; creating a dating site</a> <small>During the summer of 2007 I decided to purchase a...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hm2k.com/posts/cex-co-uk-site-errors/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HM2K&#8217;s code repository</title>
		<link>http://www.hm2k.com/posts/hm2ks-code-repository</link>
		<comments>http://www.hm2k.com/posts/hm2ks-code-repository#comments</comments>
		<pubDate>Thu, 30 Jul 2009 16:19:43 +0000</pubDate>
		<dc:creator>hm2k</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[IRC]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sysadmin]]></category>
		<category><![CDATA[AutoIT]]></category>
		<category><![CDATA[Batch]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[hm2k]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[mIRC Script]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[repository]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[TCL]]></category>
		<category><![CDATA[VBScript]]></category>

		<guid isPermaLink="false">http://www.hm2k.com/?p=429</guid>
		<description><![CDATA[HM2K&#8217;s code repository is now open for business!
This repository is a collection of scripts and code i&#8217;ve written in various languages such as mIRC Script, Perl, PHP, TCL, AutoIT, JavaScript, Shell, VB Script and Batch.
You can find the project here.
You may browse the code here.
You can raise issues here.
At the moment there&#8217;s only mIRC scripts [...]


Related posts:<ol><li><a href='http://www.hm2k.com/posts/suphp-and-phps' rel='bookmark' title='Permanent Link: suPHP and .phps PHP code highlighting support'>suPHP and .phps PHP code highlighting support</a> <small>Today a user on one of my web servers asked...</small></li>
<li><a href='http://www.hm2k.com/posts/recording-an-irc-channel-on-windows' rel='bookmark' title='Permanent Link: Recording an IRC channel on Windows'>Recording an IRC channel on Windows</a> <small>Recently Matt Cutts posted an article on his blog about...</small></li>
<li><a href='http://www.hm2k.com/posts/weather-tcl' rel='bookmark' title='Permanent Link: weather.tcl'>weather.tcl</a> <small>Today, after I decided to hang out in #eggtcl on...</small></li>
<li><a href='http://www.hm2k.com/posts/universal-currency-converter-tcl-for-eggdrop' rel='bookmark' title='Permanent Link: Universal Currency Converter TCL for Eggdrop'>Universal Currency Converter TCL for Eggdrop</a> <small>This is a currency converter written in TCL for Eggdrop,...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>HM2K&#8217;s code repository is now open for business!</p>
<p><em>This repository is a collection of scripts and code i&#8217;ve written in various languages such as mIRC Script, Perl, PHP, TCL, AutoIT, JavaScript, Shell, VB Script and Batch.<span id="more-429"></span></em></p>
<p>You can find the project <a href="http://code.google.com/p/hm2k/">here</a>.</p>
<p>You may browse the code <a href="http://code.google.com/p/hm2k/source/browse/#svn/trunk/code">here</a>.</p>
<p>You can raise issues <a href="http://code.google.com/p/hm2k/issues/list">here</a>.</p>
<p>At the moment there&#8217;s only mIRC scripts and PHP code, but I hope to eventually upload all my code here.</p>
<p>There are also no downloads, as I feel most people can comfortably browse the code or use SVN. Although I may add specific downloads on request.</p>
<p>Watch this space.</p>
<p>I hope you find this useful!</p>


<p>Related posts:<ol><li><a href='http://www.hm2k.com/posts/suphp-and-phps' rel='bookmark' title='Permanent Link: suPHP and .phps PHP code highlighting support'>suPHP and .phps PHP code highlighting support</a> <small>Today a user on one of my web servers asked...</small></li>
<li><a href='http://www.hm2k.com/posts/recording-an-irc-channel-on-windows' rel='bookmark' title='Permanent Link: Recording an IRC channel on Windows'>Recording an IRC channel on Windows</a> <small>Recently Matt Cutts posted an article on his blog about...</small></li>
<li><a href='http://www.hm2k.com/posts/weather-tcl' rel='bookmark' title='Permanent Link: weather.tcl'>weather.tcl</a> <small>Today, after I decided to hang out in #eggtcl on...</small></li>
<li><a href='http://www.hm2k.com/posts/universal-currency-converter-tcl-for-eggdrop' rel='bookmark' title='Permanent Link: Universal Currency Converter TCL for Eggdrop'>Universal Currency Converter TCL for Eggdrop</a> <small>This is a currency converter written in TCL for Eggdrop,...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hm2k.com/posts/hm2ks-code-repository/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Your Own URL as Your OpenID with WordPress</title>
		<link>http://www.hm2k.com/posts/using-your-own-url-as-your-openid-with-wordpress</link>
		<comments>http://www.hm2k.com/posts/using-your-own-url-as-your-openid-with-wordpress#comments</comments>
		<pubDate>Thu, 16 Apr 2009 22:09:33 +0000</pubDate>
		<dc:creator>hm2k</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[openid]]></category>
		<category><![CDATA[openid delegation]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.hm2k.com/?p=408</guid>
		<description><![CDATA[Today I decided to join stackoverflow.com, which requires you to login using OpenID.
It was pretty simple to get signed up with myopenid.com, but while I was on the stackoverflow login page I noticed a little message which I found interesting:

Use your own URL
Want to add OpenID support to your website?
It&#8217;s as easy as adding two [...]


Related posts:<ol><li><a href='http://www.hm2k.com/posts/10-wordpress-performance-optimisation-tips' rel='bookmark' title='Permanent Link: 10 wordpress performance optimisation tips'>10 wordpress performance optimisation tips</a> <small>I wanted to prepare my wordpress powered blog for an...</small></li>
<li><a href='http://www.hm2k.com/posts/cannot-redeclare-pclziputilpathreduction' rel='bookmark' title='Permanent Link: Cannot redeclare pclziputilpathreduction()'>Cannot redeclare pclziputilpathreduction()</a> <small>I had this issue today, I found that you need...</small></li>
<li><a href='http://www.hm2k.com/posts/adding-table-controls-and-support-to-tinymce-in-wordpress' rel='bookmark' title='Permanent Link: Adding table controls and support to TinyMCE in WordPress'>Adding table controls and support to TinyMCE in WordPress</a> <small>One thing wordpress has always lacked is the ability to...</small></li>
<li><a href='http://www.hm2k.com/posts/getting-started-with-quercus-in-google-app-engine' rel='bookmark' title='Permanent Link: Getting started with Quercus in Google App Engine'>Getting started with Quercus in Google App Engine</a> <small>Last year an article was written on a blog about...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Today I decided to join <a href="http://www.stackoverflow.com/">stackoverflow.com</a>, which requires you to login using <a href="http://openid.net/get/">OpenID</a>.</p>
<p>It was pretty simple to get signed up with <a href="https://www.myopenid.com/">myopenid.com</a>, but while I was on the <a href="http://stackoverflow.com/users/login?returnurl=%2f">stackoverflow login page</a> I noticed a little message which I found interesting:<span id="more-408"></span></p>
<blockquote>
<h4>Use your own URL</h4>
<p>Want to add OpenID support to <em>your</em> website?</p>
<p>It&#8217;s as easy as adding two HTML header tags!</p>
<p><a href="http://blog.stackoverflow.com/2009/01/using-your-own-url-as-your-openid/">Read more..</a></p></blockquote>
<p>It basically would mean I could use &#8220;hm2k.com&#8221; instead of &#8220;hm2k.myopenid.com&#8221; to login with OpenID, which is pretty neat. There&#8217;s also a section in the help on <a href="https://www.myopenid.com/help#own_domain">myOpenID.com for using your own domain</a>, which confirms this.</p>
<p>Seems easy enough, I thought. Then I took into consideration that I&#8217;m using wordpress, sure not a major problem, I can simply hard code it into my theme, but then do I really want to do that? No, of course not.</p>
<p>Wordpress is renound for it&#8217;s ability to be compltely dynamic, I want to stick in line with that. More importantly, I want my OpenID URL to work regardless of what theme I&#8217;m using.</p>
<p>So I decided to start looking into it. I soon discovered someone over at wordpress.com had the same idea and had requested a way to <a href="http://en.forums.wordpress.com/topic/add-openid-delegation-link-to-head">add OpenID delegation link to head</a>.</p>
<p>At first I thought about getting a plugin that would inject the required lines of HTML into the head, however after some quite extensive research I found what I was looking for&#8230;</p>
<p><img class="alignnone size-full wp-image-409" title="OpenID Delegation" src="http://www.hm2k.com/upload/screenshot-5.png" alt="OpenID Delegation" width="550" height="141" /></p>
<p><a href="http://wordpress.org/extend/plugins/openid/">The Wordpress OpenID Plugin</a> allows users authorized to use the OpenID Provider can delegate to a different provider, among other things.</p>
<p>Once you have installed and activated the plugin you need to do the following:</p>
<ol>
<li>Go to the OpenID settings page (/wp-admin/options-general.php?page=openid)</li>
<li>Set the &#8220;Blog Owner&#8221; as yourself, and click &#8220;Save Changes&#8221;.</li>
<li>Go to your profile (/wp-admin/profile.php) and scroll to the bottom where it says &#8220;OpenID Delegation&#8221;.</li>
<li>In the edit box you would provide your OpenID URL (ie: http://hm2k.myopenid.com/)</li>
</ol>
<p>Now when I check the source code of my site I see the following HTML in the &lt;head&gt;:</p>
<blockquote><p>&lt;link rel=&#8221;openid2.provider&#8221; href=&#8221;http://www.myopenid.com/server&#8221; /&gt;<br />
&lt;link rel=&#8221;openid2.local_id&#8221; href=&#8221;http://hm2k.myopenid.com/&#8221; /&gt;<br />
&lt;link rel=&#8221;openid.server&#8221; href=&#8221;http://www.myopenid.com/server&#8221; /&gt;<br />
&lt;link rel=&#8221;openid.delegate&#8221; href=&#8221;http://hm2k.myopenid.com/&#8221; /&gt;</p></blockquote>
<p>Perfect!</p>
<p>I hope you find this as useful as I have.</p>


<p>Related posts:<ol><li><a href='http://www.hm2k.com/posts/10-wordpress-performance-optimisation-tips' rel='bookmark' title='Permanent Link: 10 wordpress performance optimisation tips'>10 wordpress performance optimisation tips</a> <small>I wanted to prepare my wordpress powered blog for an...</small></li>
<li><a href='http://www.hm2k.com/posts/cannot-redeclare-pclziputilpathreduction' rel='bookmark' title='Permanent Link: Cannot redeclare pclziputilpathreduction()'>Cannot redeclare pclziputilpathreduction()</a> <small>I had this issue today, I found that you need...</small></li>
<li><a href='http://www.hm2k.com/posts/adding-table-controls-and-support-to-tinymce-in-wordpress' rel='bookmark' title='Permanent Link: Adding table controls and support to TinyMCE in WordPress'>Adding table controls and support to TinyMCE in WordPress</a> <small>One thing wordpress has always lacked is the ability to...</small></li>
<li><a href='http://www.hm2k.com/posts/getting-started-with-quercus-in-google-app-engine' rel='bookmark' title='Permanent Link: Getting started with Quercus in Google App Engine'>Getting started with Quercus in Google App Engine</a> <small>Last year an article was written on a blog about...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hm2k.com/posts/using-your-own-url-as-your-openid-with-wordpress/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cannot redeclare pclziputilpathreduction()</title>
		<link>http://www.hm2k.com/posts/cannot-redeclare-pclziputilpathreduction</link>
		<comments>http://www.hm2k.com/posts/cannot-redeclare-pclziputilpathreduction#comments</comments>
		<pubDate>Tue, 17 Feb 2009 12:49:27 +0000</pubDate>
		<dc:creator>hm2k</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[pclziputilpathreduction]]></category>
		<category><![CDATA[upgrading]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.hm2k.com/posts/cannot-redeclare-pclziputilpathreduction</guid>
		<description><![CDATA[I had this issue today, I found that you need to deactivate the &#8220;Wordpress Automatic Upgrade&#8221; plugin as it&#8217;s included in the core of Wordpress now anyway.
So, just disable the plugin and try again.
WordPress Upgrade Error Solved &#8211; Fatal error: Cannot redeclare pclziputilpathreduction()


Related posts:10 wordpress performance optimisation tips I wanted to prepare my wordpress powered [...]


Related posts:<ol><li><a href='http://www.hm2k.com/posts/10-wordpress-performance-optimisation-tips' rel='bookmark' title='Permanent Link: 10 wordpress performance optimisation tips'>10 wordpress performance optimisation tips</a> <small>I wanted to prepare my wordpress powered blog for an...</small></li>
<li><a href='http://www.hm2k.com/posts/using-your-own-url-as-your-openid-with-wordpress' rel='bookmark' title='Permanent Link: Using Your Own URL as Your OpenID with WordPress'>Using Your Own URL as Your OpenID with WordPress</a> <small>Today I decided to join stackoverflow.com, which requires you to...</small></li>
<li><a href='http://www.hm2k.com/posts/getting-started-with-quercus-in-google-app-engine' rel='bookmark' title='Permanent Link: Getting started with Quercus in Google App Engine'>Getting started with Quercus in Google App Engine</a> <small>Last year an article was written on a blog about...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I had this issue today, I found that you need to deactivate the &#8220;Wordpress Automatic Upgrade&#8221; plugin as it&#8217;s included in the core of Wordpress now anyway.</p>
<p>So, just disable the plugin and try again.</p>
<p><span id="more-387"></span><a href="http://www.youtube.com/watch?v=OGeyrdW1KSw">WordPress Upgrade Error Solved &#8211; Fatal error: Cannot redeclare pclziputilpathreduction()</a></p>


<p>Related posts:<ol><li><a href='http://www.hm2k.com/posts/10-wordpress-performance-optimisation-tips' rel='bookmark' title='Permanent Link: 10 wordpress performance optimisation tips'>10 wordpress performance optimisation tips</a> <small>I wanted to prepare my wordpress powered blog for an...</small></li>
<li><a href='http://www.hm2k.com/posts/using-your-own-url-as-your-openid-with-wordpress' rel='bookmark' title='Permanent Link: Using Your Own URL as Your OpenID with WordPress'>Using Your Own URL as Your OpenID with WordPress</a> <small>Today I decided to join stackoverflow.com, which requires you to...</small></li>
<li><a href='http://www.hm2k.com/posts/getting-started-with-quercus-in-google-app-engine' rel='bookmark' title='Permanent Link: Getting started with Quercus in Google App Engine'>Getting started with Quercus in Google App Engine</a> <small>Last year an article was written on a blog about...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hm2k.com/posts/cannot-redeclare-pclziputilpathreduction/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OpenCart v0.7.9 released</title>
		<link>http://www.hm2k.com/posts/opencart-v079-released</link>
		<comments>http://www.hm2k.com/posts/opencart-v079-released#comments</comments>
		<pubDate>Mon, 02 Feb 2009 13:32:13 +0000</pubDate>
		<dc:creator>hm2k</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.hm2k.com/?p=380</guid>
		<description><![CDATA[OpenCart is an open source PHP-based e-commerce online shop website solution. Ideal for new or existing stores to start selling online.
OpenCart all began because (at the time) the leading open source e-commerce solution out there was not very good, to say the least.
The first public release was OpenCart v0.2 back in early 2006 and has [...]


Related posts:<ol><li><a href='http://www.hm2k.com/posts/opencart' rel='bookmark' title='Permanent Link: OpenCart v0.7.9 released'>OpenCart v0.7.9 released</a> <small>OpenCart is an open source PHP-based e-commerce online shop website...</small></li>
<li><a href='http://www.hm2k.com/posts/ecommerce-shopping-cart-software' rel='bookmark' title='Permanent Link: eCommerce shopping cart software'>eCommerce shopping cart software</a> <small>So you&#8217;ve got a shop, or perhaps a new product...</small></li>
<li><a href='http://www.hm2k.com/posts/whats-wrong-with-low-version-numbers' rel='bookmark' title='Permanent Link: What&#8217;s wrong with low version numbers?'>What&#8217;s wrong with low version numbers?</a> <small>In a presentation entitled &#8220;Why I hate Django&#8221;, Cal Henderson...</small></li>
<li><a href='http://www.hm2k.com/posts/creating-a-digg-clone-for-your-niche-market' rel='bookmark' title='Permanent Link: Creating a Digg clone for your niche market'>Creating a Digg clone for your niche market</a> <small> First of all you need to choose your weapon....</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.opencart.com/">OpenCart</a> is an open source PHP-based e-commerce online shop website solution. Ideal for new or existing stores to start selling online.</p>
<p>OpenCart all began because (at the time) the leading open source e-commerce solution out there was not very good, to say the least.</p>
<p><span id="more-380"></span>The first public release was OpenCart v0.2 back in early 2006 and has been gaining momentum ever since.</p>
<p>The project is lead by Daniel Kerr, and I have also recently joined the team.</p>
<p>I have been working on 0.7.9 since I released 0.7.8 back in July. OpenCart is now a much more stable platform, and we are now looking to start adding new features in 0.8.</p>
<p><a href="http://open-cart.googlecode.com/files/opencart_0.7.9.zip">Download OpenCart v0.7.9</a></p>
<p>If you need any assistance with OpenCart, you can find me on the <a href="http://forum.opencart.com/">OpenCart Community Forums</a>, and on the <a href="http://code.google.com/p/open-cart/">OpenCart  project site (</a><a href="http://code.google.com/p/open-cart/">Google Code)</a>.</p>
<p>Don&#8217;t forget to <a href="http://forum.opencart.com/index.php/topic,2029.0.html">donate</a>!</p>
<p>Enjoy!</p>


<p>Related posts:<ol><li><a href='http://www.hm2k.com/posts/opencart' rel='bookmark' title='Permanent Link: OpenCart v0.7.9 released'>OpenCart v0.7.9 released</a> <small>OpenCart is an open source PHP-based e-commerce online shop website...</small></li>
<li><a href='http://www.hm2k.com/posts/ecommerce-shopping-cart-software' rel='bookmark' title='Permanent Link: eCommerce shopping cart software'>eCommerce shopping cart software</a> <small>So you&#8217;ve got a shop, or perhaps a new product...</small></li>
<li><a href='http://www.hm2k.com/posts/whats-wrong-with-low-version-numbers' rel='bookmark' title='Permanent Link: What&#8217;s wrong with low version numbers?'>What&#8217;s wrong with low version numbers?</a> <small>In a presentation entitled &#8220;Why I hate Django&#8221;, Cal Henderson...</small></li>
<li><a href='http://www.hm2k.com/posts/creating-a-digg-clone-for-your-niche-market' rel='bookmark' title='Permanent Link: Creating a Digg clone for your niche market'>Creating a Digg clone for your niche market</a> <small> First of all you need to choose your weapon....</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hm2k.com/posts/opencart-v079-released/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP getmxrr() support for windows</title>
		<link>http://www.hm2k.com/posts/php-getmxrr-support-for-windows</link>
		<comments>http://www.hm2k.com/posts/php-getmxrr-support-for-windows#comments</comments>
		<pubDate>Tue, 06 Jan 2009 22:23:41 +0000</pubDate>
		<dc:creator>hm2k</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[getmxrr]]></category>

		<guid isPermaLink="false">http://www.hm2k.com/?p=332</guid>
		<description><![CDATA[As many of you may be aware there&#8217;s a lack of getmxrr() support in Windows, which dates back as far as 1999.
It&#8217;s not a major problem for me as an individual because I never use WIN32 PHP in production, but for development and for the purpose of wide distribution it can raise an issue.
Apparently the [...]


Related posts:<ol><li><a href='http://www.hm2k.com/posts/windows-genuine-advantage-removal' rel='bookmark' title='Permanent Link: Windows Genuine Advantage Removal'>Windows Genuine Advantage Removal</a> <small>First of all for those that don&#8217;t know, Windows Genuine...</small></li>
<li><a href='http://www.hm2k.com/posts/cex-co-uk-site-errors' rel='bookmark' title='Permanent Link: Cex.co.uk site errors'>Cex.co.uk site errors</a> <small>After browsing the cex.co.uk website for some time I came...</small></li>
<li><a href='http://www.hm2k.com/posts/how-to-create-a-boot-cd-for-windows-me' rel='bookmark' title='Permanent Link: How to create a boot CD for Windows ME'>How to create a boot CD for Windows ME</a> <small>Today I was given a machine that has Windows ME...</small></li>
<li><a href='http://www.hm2k.com/posts/php-coding-standards-and-best-practices' rel='bookmark' title='Permanent Link: PHP coding standards and best practices'>PHP coding standards and best practices</a> <small>I have been using PHP for a long time now,...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>As many of you may be aware there&#8217;s <a href="http://bugs.php.net/bug.php?id=5311">a lack of getmxrr() support in Windows</a>, which dates back as far as <a href="http://bugs.php.net/bug.php?id=1660">1999</a>.</p>
<p>It&#8217;s not a major problem for me as an individual because I never use WIN32 PHP in production, but for development and for the purpose of wide distribution it can raise an issue.</p>
<p>Apparently the lack of support in win32 is due to the <a href="http://bugs.php.net/bug.php?id=7288">lack of &#8220;res_search&#8221; in &#8220;bindlib_w32&#8243;</a>, I&#8217;m surprised this hasn&#8217;t been fixed already.</p>
<p>The official PHP.net documentation for the  <a href="http://www.php.net/getmxrr">getmxrr()</a> function states:</p>
<blockquote><p><strong class="note">Note</strong>:          This function is not implemented on Windows platforms. Try the     <a class="link external" href="http://pear.php.net/">» PEAR</a> class     <a class="link external" href="http://pear.php.net/package/Net_DNS">» Net_DNS</a>.</p></blockquote>
<p>However, there are problems with this suggestion&#8230;</p>
<p><span id="more-332"></span></p>
<ol>
<li>Some users don&#8217;t have access to install the required PEAR module.</li>
<li><em>pear/Net_DNS requires PHP extension &#8220;mhash&#8221;</em> &#8211; some users may not have this installed.</li>
<li>The Net_DNS class does not have a direct equivalent to getmxrr() so results may not be as expected.</li>
<li>It&#8217;s not a portable solution, especially if some users experience the above issues.</li>
</ol>
<p>This isn&#8217;t going to be a realistic option for many users.</p>
<p>So, what are the alternatives? Do they have any issues?</p>
<ol>
<li>Use <a href="http://www.php.net/exec">exec()</a> in conjunction with &#8220;<a href="http://support.microsoft.com/kb/200525">nslookup.exe</a>&#8220;.
<ul>
<li>When safe mode is enabled, you can only execute files within the safe_mode_exec_dir. For practical reasons, it is currently not allowed to have .. components in the path to the executable.</li>
<li>&#8220;nslookup.exe&#8221; may not exist on the system.</li>
<li>PHP may not have permission to run &#8220;nslookup.exe&#8221;.</li>
</ul>
</li>
<li>Write your own class/function to <a href="http://www.php.net/fsockopen">fsockopen()</a> via UDP to a name server and parse the returned information.
<ul>
<li>Long and overly complex.</li>
<li>Requires understanding of the <a href="http://www.dns.net/dnsrd/rfc/">DNS related RFCs</a>.</li>
<li>Reinventing the wheel, as Net_DNS already handles this.</li>
<li>Results may not be as expected.</li>
</ul>
</li>
<li>Fix the implementation problem in PHP core.
<ul>
<li>Not very simple to implement.</li>
<li>May be a complex issue.</li>
<li>Not backwards compatible.</li>
</ul>
</li>
</ol>
<p>I think the obvious option here is to run with the first option of using &#8220;nslookup&#8221; and hope for the best.</p>
<p>With any luck you will find the &#8220;<a href="http://www.google.com/search?q=&quot;getmxrr()+support+for+Windows&quot;+site%3Aphp.net+OR+site%3Agoogle.com">getmxrr() support for Windows</a>&#8221; function in on the <a href="http://www.php.net/getmxrr">getmxrr()</a> manual page (<em>find the latest <a href="?dl=getmxrr.phps">here</a></em>).</p>
<p><strong>NEWS FLASH!</strong></p>
<p>As I write this, and go over the article again, check my links, I see an update on the <a href="http://bugs.php.net/bug.php?id=5311">PHP Bug #5311</a> tracker:</p>
<blockquote>
<pre class="note">As a new year present, all DNS functions are now available on windows,
5.3 and 6 (head).</pre>
</blockquote>
<p>This is good news, all that remains is for <a href="http://pear.php.net/package/PHP_Compat">PHP_Compat</a> to catch up and use the above suggestions <img src='http://www.hm2k.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Good luck.</p>
<p><strong>Update:</strong> I am now helping the PHP_Compat team. View the <a href="http://pear.php.net/bugs/bug.php?id=15531">getmxrr() support for windows feature request</a>.</p>
<p><strong>Update2:</strong> I have now decided to support <a href="http://www.php.net/checkdnsrr">checkdnsrr()</a> as well. <a href="?dl=checkdnsrr.phps">Download checkdnsrr() support for windows</a>.</p>
<p><strong>Update3:</strong> I have now decided to support <a href="http://www.php.net/dns_get_record">dns_get_record()</a> as well. Coming soon.</p>


<p>Related posts:<ol><li><a href='http://www.hm2k.com/posts/windows-genuine-advantage-removal' rel='bookmark' title='Permanent Link: Windows Genuine Advantage Removal'>Windows Genuine Advantage Removal</a> <small>First of all for those that don&#8217;t know, Windows Genuine...</small></li>
<li><a href='http://www.hm2k.com/posts/cex-co-uk-site-errors' rel='bookmark' title='Permanent Link: Cex.co.uk site errors'>Cex.co.uk site errors</a> <small>After browsing the cex.co.uk website for some time I came...</small></li>
<li><a href='http://www.hm2k.com/posts/how-to-create-a-boot-cd-for-windows-me' rel='bookmark' title='Permanent Link: How to create a boot CD for Windows ME'>How to create a boot CD for Windows ME</a> <small>Today I was given a machine that has Windows ME...</small></li>
<li><a href='http://www.hm2k.com/posts/php-coding-standards-and-best-practices' rel='bookmark' title='Permanent Link: PHP coding standards and best practices'>PHP coding standards and best practices</a> <small>I have been using PHP for a long time now,...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hm2k.com/posts/php-getmxrr-support-for-windows/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHPizabi &#8211; creating a dating site</title>
		<link>http://www.hm2k.com/posts/phpizabi-creating-a-dating-site</link>
		<comments>http://www.hm2k.com/posts/phpizabi-creating-a-dating-site#comments</comments>
		<pubDate>Tue, 23 Dec 2008 11:00:36 +0000</pubDate>
		<dc:creator>hm2k</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Rants]]></category>
		<category><![CDATA[dating]]></category>
		<category><![CDATA[phpizabi]]></category>

		<guid isPermaLink="false">http://www.hm2k.com/?p=301</guid>
		<description><![CDATA[During the summer of 2007 I decided to purchase a new domain name with a dating theme.
The idea was to start a dating website. Although a fairly saturated market place, I figured it&#8217;d be another one to add to my profile.
Earlier on in the year I remember coming across an article on the .net magazine [...]


Related posts:<ol><li><a href='http://www.hm2k.com/posts/whats-wrong-with-low-version-numbers' rel='bookmark' title='Permanent Link: What&#8217;s wrong with low version numbers?'>What&#8217;s wrong with low version numbers?</a> <small>In a presentation entitled &#8220;Why I hate Django&#8221;, Cal Henderson...</small></li>
<li><a href='http://www.hm2k.com/posts/creating-a-digg-clone-for-your-niche-market' rel='bookmark' title='Permanent Link: Creating a Digg clone for your niche market'>Creating a Digg clone for your niche market</a> <small> First of all you need to choose your weapon....</small></li>
<li><a href='http://www.hm2k.com/posts/opencart' rel='bookmark' title='Permanent Link: OpenCart v0.7.9 released'>OpenCart v0.7.9 released</a> <small>OpenCart is an open source PHP-based e-commerce online shop website...</small></li>
<li><a href='http://www.hm2k.com/posts/opencart-v079-released' rel='bookmark' title='Permanent Link: OpenCart v0.7.9 released'>OpenCart v0.7.9 released</a> <small>OpenCart is an open source PHP-based e-commerce online shop website...</small></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>During the summer of 2007 I decided to purchase a new domain name with a dating theme.</p>
<p>The idea was to start a dating website. Although a fairly saturated market place, I figured it&#8217;d be another one to add to my profile.</p>
<p><span id="more-301"></span>Earlier on in the year I remember coming across an article on the .net magazine website, entitled &#8220;<a href="http://www.netmag.co.uk/zine/develop-tutorials/date_part1">Creating your own dating site</a>&#8221; (<a href="http://www.netmag.co.uk/zine/develop-tutorials/date_part2">part2</a>, <a href="http://www.netmag.co.uk/zine/develop-tutorials/date_part3">part3</a>).</p>
<p>In the article <a href="http://www.spodgod.com/">Karl Hodge</a> explains how PHPizabi is the ideal social networking site engine with messaging and chat features.</p>
<p>One of the most interesting statements very early on in this article is this:</p>
<blockquote><p>PHPizabi is a refreshingly professional, 100 per cent open source, social networking and dating application.</p></blockquote>
<p>But we&#8217;ll come back to this later.</p>
<p>We begin with the preparation steps, where we see a screenshot of the author&#8217;s attempt: &#8220;<a href="http://dogmeet.net/">dogmeet.net</a>&#8221; &#8211; it looks pretty neat.</p>
<p>Sure i&#8217;m a pretty advanced user, so I&#8217;ll skip this and jump directly to the comments to see what&#8217;s been said.</p>
<blockquote><p>just google phpizabi and you get <a href="http://www.phpizabi.net/" target="_blank">www.phpizabi.net</a> &#8211; it&#8217;s open source which means you can download it all from the interweb.</p></blockquote>
<p>Thanks Sam, this should get me started.</p>
<p>Visiting the site, I&#8217;m greeted with quite a pretty looking site, however the last entry in their news is a vulnerability report from back in August 2008, I figured this would be fixed by now and proceeded to download regardless.</p>
<p>The file I got given was &#8220;<a href="http://www.phpizabi.net/?L=downloads.downloadcore&amp;X=dist.core.download&amp;latest=1">PHPizabi_0.848b_C1_HFP1.zip</a>&#8220;.</p>
<p>I skip to step 2: Installation.</p>
<p>I quickly notice that the installation I&#8217;m using is nothing like the (better looking) screenshots in the tutorial, but I thought &#8220;never mind it must be a newer version&#8221;.</p>
<p>Upon completion of the fairly straightforward installation I get straight to work.</p>
<p>First thing I look at is the themes. There is only one provided and it looks nothing like the (better looking) one seen on the article. Strange, I thought, perhaps they are using a different package.</p>
<p>From here I proceeded to to investigate what other themes I can get for free. I soon found out that &#8220;not many&#8221; was the answer, although I did find a link entitled &#8220;<a href="http://digg.com/programming/PhpIzabi_Mods_24_mods_themes_FREE_DOWNLOAD">PhpIzabi Mods, 24 mods &amp; themes:FREE DOWNLOAD</a>&#8220;. I figured it may be worth a look at.</p>
<p>Pretty wrong. The themes were no better coded than the shipped one. Poor markup, poor use of CSS, and just generally not very good looking.</p>
<p>This would take some time to cleanup. I started anyway.</p>
<p>I cleaned up the &#8220;frame.tpl&#8221; making it all XHTML, removed the table layout, and added new styles to handle it. I also cleaned up &#8220;home.tpl&#8221; and a few more of the tpl files.</p>
<p>I eventually started getting somewhere, so decided to browse around the site I had started to form. Some of the pages simply didn&#8217;t look right, and wouldn&#8217;t populate correctly. I decided to look at the code.</p>
<p>In a way, I wish I never had. In the &#8220;index.php&#8221; I noticed a lot of poor coding, stuff that I&#8217;d not seen since about 2005, makes sense since the copyright says 2005, and last modification date was September 3rd 2006.</p>
<p>This isn&#8217;t very reassuring, this would need a LOT of work to bring it up to speed for 2008. Perhaps I downloaded the wrong version? There must be a more up to date version or a simply better version?</p>
<p>It was at this point that I decided to read the included documentation starting with the &#8220;UPDATE_README.TXT&#8221;. Here I find this:</p>
<blockquote><p>To perform an update from PHPizabi 0.4XX, please visit the PIO website to download<br />
the latest migration tool &#8211; <a href="http://online.phpizabi.net">http://online.phpizabi.net</a></p></blockquote>
<p>Interesting. 0.4XX must have been a fairly popular version for them to create a migration tool for and I also found that the &#8220;phpizabi online&#8221; contained lots of mods and themes.</p>
<p>However, looking at the &#8220;core&#8221; releases I found that the latest release was &#8220;Mar. 5th 2007&#8243;. This is not good for any project.</p>
<p>What the hell is going on here? Time to do some <a href="http://www.google.co.uk/search?q=phpizabi">research</a>.</p>
<p>I came across the <a href="http://demo.phpizabi.net/">PHPizabi demo site</a>, which looks similar to the version I have (apart from the mention of Alicia), only it has broken pages too (see <a href="http://demo.phpizabi.net/?L=inkspot.index">Inkspot</a>). I&#8217;m convinced I have the wrong version now.</p>
<p>This is when I discover phpizabi.com, and their <a href="http://www.phpizabi.com/?L=info.about">about</a> section:</p>
<blockquote><p>PHPizabi was founded in mid 2005 by Jeff Knipp whom hired Claude Desjardens to code a personal website. A short time later Claude and Jeff agreed to become 50/50 partners and the personal project became what was destined to be known as PHPizabi.</p>
<p>In August 2005 the first release of PHPizabi was made available to the general public to download free of charge. PHPizabi has gained international fame through various publications as one of the best free community software on the market and has a broad following of users.</p>
<p>In November 2006, Jeff was illegally removed from the PHPizabi project by Claude Desjardens. Though legal remedy has not been ruled out, the best interest of the community was taken into consideration and thus the creation of this site which was created to offer the community an alternative to the non-community oriented support provided by the PHPizabi.net site.</p>
<p>Where the net site surrounds themselves around those only wishing to make a buck or two by allowing people to sell 1 line code mods for ridiculous prices, we believe in the open source community spirit. While we do have the Mod Club, we have many mods that are free, and as always support is 100% free.</p></blockquote>
<p>Turns out there&#8217;s <a href="http://chris.instantspot.com/blog/2006/12/15/PHPizabi-got-jacked">legal issues surrounding this project</a>. This is no good.</p>
<p>I decided to return the original article and try and figure out where it all went so wrong.</p>
<p>On the first page, I find the following statements which I had clearly missed:</p>
<blockquote><p>Find the file PHPizabi_0.415b_R3.zip on this issue’s CD and drag it over to your hard drive</p>
<p>return to the CD and find the file 0415bR3_sphfixHFP.zip</p></blockquote>
<p>As it seems, they ARE using a different version, it appears to be the earlier 0.4XX version mentioned in the upgrade text in the newer version. I found this:</p>
<blockquote><p><a href="http://www.phpizabi.net/legacy_packages/PHPizabi_0.415b_R4.zip">PHPizabi 0.415b R4</a> 6.03Mb      11/23/2005      No support      Encrypted (IonCube)</p></blockquote>
<p>Low and behold here we have the version mentioned in the article, released back in 2005, however it has IonCube Encryption on the core files. Odd because I remember the article saying that it was 100% open source. Guess not.</p>
<p>Further research via <a href="http://news.google.co.uk/archivesearch?q=phpizabi">google news</a> finds me an article describing <a href="http://www.vupen.com/english/advisories/2008/0585">a known vulnerability in PHPizabi</a>. I also discovered that there is <a href="http://xforce.iss.net/xforce/xfdb/44509">still no fix</a>, dubbing PHPizabi as <a href="http://digg.com/programming/PHPizabi_the_most_hackable_Dating_Script_on_the_Internet_2">the most hackable Dating Script on the Internet</a>. There&#8217;s no end to security issues in PHPizabi.</p>
<p>It seems I&#8217;m not alone, others have also had <a href="http://forums.digitalpoint.com/showthread.php?t=455622">bad experiences with PHPizabi</a> and apparently <a href="http://www.byrobert.com/robblog/2007/03/03/phpizabis-dating-software-is-greatbut-one-in-support-sucks/">support sucks even when you pay</a>.</p>
<p>So what now? I CANNOT use this, it&#8217;s unprofessional, barely usable, unmaintainable, poorly coded and worst of all vulnerable to exploitation. This project is dead.</p>
<p>So with the help of my earlier research, and <a href="http://en.wikipedia.org/wiki/Comparison_of_social_networking_software">wikipedia</a>, I found some alternatives:</p>
<ul>
<li><a href="http://www.tufat.com/s_free_dating_system.htm">OSDate</a></li>
<li><a href="http://www.boonex.com/products/dolphin/">Boonex Dolphin</a></li>
<li><a href="http://www.dzoic.com/">DZOIC</a></li>
<li><a href="http://www.socialengine.net/">SocialEngine</a></li>
<li><a href="http://www.phpfox.com/">phpFox</a></li>
<li><a href="http://www.barnraiser.org/aroundme">AroundMe</a></li>
<li><a href="http://peopleaggregator.net/">PeopleAggregator</a></li>
<li><a href="http://elgg.org/">ELGG</a></li>
<li><a href="http://developer.mugshot.org/">Mugshot</a></li>
<li><a href="http://drupal.org/">Drupal</a></li>
<li><a href="http://communityserver.com/">Community Server</a></li>
<li><a href="http://www.joomla.org/">Joomla!</a></li>
<li><a href="http://virtuoso.openlinksw.com/wiki/main/Main/Ods">ODS</a></li>
</ul>
<p>Also checkout this <a href="http://www.techcrunch.com/wp-content/white_label_social_networking_solutions_chart2.html">social networking solution comparison table at techcrunch</a>.</p>
<p>What did you decide to go with and why?</p>
<p>Hopefully a &#8220;refreshingly professional, 100 per cent open source, social networking and dating application&#8221;, but I don&#8217;t hold high hopes.</p>
<p><strong>UPDATE:</strong> I decided to share my article with the <a href="http://www.phpizabi.com/forum/">PHPizabi.com forum</a>, however I guess they didn&#8217;t agree with me as I&#8217;m banned. The reply post notification via email from blackbook says: &#8220;yea ya like giving links to my paid mods for free..your banned dude&#8221;, thanks, as good as an excuse as any I guess, but it begs the question: now who&#8217;s &#8220;wishing to make a buck or two&#8221;? Besides, let&#8217;s face it, if nobody is going to want to use PHPizabi, who&#8217;s going to want to use the mods anyway?</p>
<p><strong>UPDATE2: </strong>I&#8217;m looking at writing a dating site solution using CakePHP as the framework, based on Matt Inman&#8217;s <a href="http://mingle2.com/blog/view/how-i-built-mingle2">Mingle2</a>. I sympathise with his decision to write his own solution. Wish me luck!</p>


<p>Related posts:<ol><li><a href='http://www.hm2k.com/posts/whats-wrong-with-low-version-numbers' rel='bookmark' title='Permanent Link: What&#8217;s wrong with low version numbers?'>What&#8217;s wrong with low version numbers?</a> <small>In a presentation entitled &#8220;Why I hate Django&#8221;, Cal Henderson...</small></li>
<li><a href='http://www.hm2k.com/posts/creating-a-digg-clone-for-your-niche-market' rel='bookmark' title='Permanent Link: Creating a Digg clone for your niche market'>Creating a Digg clone for your niche market</a> <small> First of all you need to choose your weapon....</small></li>
<li><a href='http://www.hm2k.com/posts/opencart' rel='bookmark' title='Permanent Link: OpenCart v0.7.9 released'>OpenCart v0.7.9 released</a> <small>OpenCart is an open source PHP-based e-commerce online shop website...</small></li>
<li><a href='http://www.hm2k.com/posts/opencart-v079-released' rel='bookmark' title='Permanent Link: OpenCart v0.7.9 released'>OpenCart v0.7.9 released</a> <small>OpenCart is an open source PHP-based e-commerce online shop website...</small></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.hm2k.com/posts/phpizabi-creating-a-dating-site/feed</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
