<?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>Cool Geex &#187; PHP / MySql</title>
	<atom:link href="http://www.coolgeex.com/category/php-mysql/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.coolgeex.com</link>
	<description>Gadget and tech guide for the rest of us</description>
	<lastBuildDate>Fri, 07 Oct 2011 04:57:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
	<atom:link rel='hub' href='http://www.coolgeex.com/?pushpress=hub'/>
		<item>
		<title>SendGrid API &#8211; PHP Library</title>
		<link>http://www.coolgeex.com/sendgrid-api-php-library/</link>
		<comments>http://www.coolgeex.com/sendgrid-api-php-library/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 20:06:12 +0000</pubDate>
		<dc:creator>Cool Geex</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[PHP / MySql]]></category>
		<category><![CDATA[SendGrid]]></category>

		<guid isPermaLink="false">http://www.coolgeex.com/?p=921</guid>
		<description><![CDATA[Like promised in my last SendGrid post here, I&#8217;m extending SendGrid PHP Library. The new github project hosted here:  https://github.com/alonbendavid/SendGrid-PHP-Library Now includes Newsletter and Web API&#8217;s]]></description>
			<content:encoded><![CDATA[<p>Like promised in my last SendGrid post <a href="http://www.coolgeex.com/sendgrid-newsletter-api-php-library/">here</a>, I&#8217;m extending SendGrid PHP Library.</p>
<p>The new github project hosted here:  <a href="https://github.com/alonbendavid/SendGrid-PHP-Library">https://github.com/alonbendavid/SendGrid-PHP-Library</a><br />
Now includes Newsletter and Web API&#8217;s</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coolgeex.com/sendgrid-api-php-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SendGrid Newsletter API &#8211; PHP Library</title>
		<link>http://www.coolgeex.com/sendgrid-newsletter-api-php-library/</link>
		<comments>http://www.coolgeex.com/sendgrid-newsletter-api-php-library/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 23:53:09 +0000</pubDate>
		<dc:creator>Cool Geex</dc:creator>
				<category><![CDATA[API]]></category>
		<category><![CDATA[Cloud]]></category>
		<category><![CDATA[PHP / MySql]]></category>
		<category><![CDATA[SendGrid]]></category>

		<guid isPermaLink="false">http://www.coolgeex.com/?p=916</guid>
		<description><![CDATA[SendGrid is a cloud-based email infrastructure relieves businesses of the cost and complexity of maintaining custom email systems. SendGrid provides reliable delivery, scalability and real-time analytics along with flexible API&#8217;s that make custom integration a breeze. The only thing is that SendGrid is a new company and no one yet created a good PHP library [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.coolgeex.com/wp-content/uploads/2011/08/sendgrid.jpg"><img class="aligncenter size-full wp-image-919" title="sendgrid" src="http://www.coolgeex.com/wp-content/uploads/2011/08/sendgrid.jpg" alt="" width="482" height="286" /></a></p>
<p>SendGrid is a cloud-based email infrastructure relieves businesses of the cost and complexity of maintaining custom email systems.</p>
<p><a href="http://sendgrid.com/">SendGrid</a> provides reliable delivery, scalability and real-time analytics along with flexible API&#8217;s that make custom integration a breeze.</p>
<p>The only thing is that SendGrid is a new company and no one yet created a good PHP library for their API.</p>
<p>Today I created one and published it on github.com , in the near future I plan to complete the full library for all of their services.</p>
<p>You can find it here: <a title="SendGrid Newsletter PHP Library" href="https://github.com/alonbendavid/SendGrid-Newsletter-PHP-Library">https://github.com/alonbendavid/SendGrid-Newsletter-PHP-Library</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.coolgeex.com/sendgrid-newsletter-api-php-library/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rackspace Cloud DNS API &#8211; PHP Class</title>
		<link>http://www.coolgeex.com/rackspace-cloud-dns-api-php-class/</link>
		<comments>http://www.coolgeex.com/rackspace-cloud-dns-api-php-class/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 23:28:08 +0000</pubDate>
		<dc:creator>Cool Geex</dc:creator>
				<category><![CDATA[Cloud]]></category>
		<category><![CDATA[PHP / MySql]]></category>
		<category><![CDATA[Rackspace]]></category>

		<guid isPermaLink="false">http://www.coolgeex.com/?p=909</guid>
		<description><![CDATA[I love Rackspace cloud, I use them for all of my projects. The only thing that lack with Rackspace Cloud is a good DNS control panel. Recently Rackspace announced the Rackspace Cloud Domain Name Service (DNS) API This service will allow customers to programmatically create and manage their DNS records. I looked for a PHP [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.rackspace.com/cloud/cloud_hosting_products/dns/"><img class="aligncenter size-full wp-image-912" title="rackspace-dns" src="http://www.coolgeex.com/wp-content/uploads/2011/08/rackspace-dns.png" alt="" width="468" height="434" /></a></p>
<p>I love Rackspace cloud, I use them for all of my projects.<br />
The only thing that lack with Rackspace Cloud is a good DNS control panel.</p>
<p>Recently Rackspace announced the Rackspace Cloud Domain Name Service (DNS) API</p>
<p>This service will allow customers to programmatically create and manage their DNS records.</p>
<p>I looked for a PHP class and I found php-cloudDNS on github.com. The class is pretty great but misses few functions and US cloud support.</p>
<p>So I forked it, edited it and submitted it here : <a href="https://github.com/alonbendavid/php-cloudDNS">https://github.com/alonbendavid/php-cloudDNS</a></p>
<p>Check out sample.php for code samples.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coolgeex.com/rackspace-cloud-dns-api-php-class/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Email Address Validator</title>
		<link>http://www.coolgeex.com/php-email-address-validator/</link>
		<comments>http://www.coolgeex.com/php-email-address-validator/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 00:40:58 +0000</pubDate>
		<dc:creator>Cool Geex</dc:creator>
				<category><![CDATA[PHP / MySql]]></category>

		<guid isPermaLink="false">http://www.coolgeex.com/?p=25</guid>
		<description><![CDATA[Few Years ago I wrote an email validator function for sites forms, one that I used until I found email address validator from Google Code.Enjoy the code by clicking the download now button. [PHP]check_text_length($strEmailAddress, 3, 256)) { return false; } // Split it into sections using last instance of &#8220;@&#8221; $intAtSymbol = strrpos($strEmailAddress, &#8216;@&#8217;); if [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><img class="size-thumbnail wp-image-26 aligncenter" title="email-validator" src="http://www.coolgeex.com/wp-content/uploads/2009/08/email-validator-150x143.gif" alt="email-validator" width="150" height="143" /></p>
<p>Few Years ago I wrote an email validator function for sites forms, one that I used until I found email address validator from Google Code.Enjoy the code by clicking the download now button.</p>
<form style="text-align: left;">
<input onclick="window.location.href='http://www.coolgeex.com/http://www.coolgeex.com/wp-content/uploads/2009/08/EmailAddressValidator.php.zip'" type="button" value="Download Now" /></form>
<p><span id="more-25"></span></p>
<p>[PHP]check_text_length($strEmailAddress, 3, 256)) {<br />
return false;<br />
}</p>
<p>// Split it into sections using last instance of &#8220;@&#8221;<br />
$intAtSymbol = strrpos($strEmailAddress, &#8216;@&#8217;);<br />
if ($intAtSymbol === false) {<br />
// No &#8220;@&#8221; symbol in email.<br />
return false;<br />
}<br />
$arrEmailAddress[0] = substr($strEmailAddress, 0, $intAtSymbol);<br />
$arrEmailAddress[1] = substr($strEmailAddress, $intAtSymbol + 1);</p>
<p>// Count the &#8220;@&#8221; symbols. Only one is allowed, except where<br />
// contained in quote marks in the local part. Quickest way to<br />
// check this is to remove anything in quotes. We also remove<br />
// characters escaped with backslash, and the backslash<br />
// character.<br />
$arrTempAddress[0] = preg_replace(&#8216;/./&#8217;<br />
,&#8221;<br />
,$arrEmailAddress[0]);<br />
$arrTempAddress[0] = preg_replace(&#8216;/&#8221;[^"]+&#8221;/&#8217;<br />
,&#8221;<br />
,$arrTempAddress[0]);<br />
$arrTempAddress[1] = $arrEmailAddress[1];<br />
$strTempAddress = $arrTempAddress[0] . $arrTempAddress[1];<br />
// Then check &#8211; should be no &#8220;@&#8221; symbols.<br />
if (strrpos($strTempAddress, &#8216;@&#8217;) !== false) {<br />
// &#8220;@&#8221; symbol found<br />
return false;<br />
}</p>
<p>// Check local portion<br />
if (!$this-&amp;gt;check_local_portion($arrEmailAddress[0])) {<br />
return false;<br />
}</p>
<p>// Check domain portion<br />
if (!$this-&amp;gt;check_domain_portion($arrEmailAddress[1])) {<br />
return false;<br />
}</p>
<p>// If we&#8217;re still here, all checks above passed. Email is valid.<br />
return true;</p>
<p>}</p>
<p>/**<br />
* Checks email section before &#8220;@&#8221; symbol for validity<br />
* @param   strLocalPortion     Text to be checked<br />
* @return  True if local portion is valid, false if not<br />
*/<br />
protected function check_local_portion($strLocalPortion) {<br />
// Local portion can only be from 1 to 64 characters, inclusive.<br />
// Please note that servers are encouraged to accept longer local<br />
// parts than 64 characters.<br />
if (!$this-&amp;gt;check_text_length($strLocalPortion, 1, 64)) {<br />
return false;<br />
}<br />
// Local portion must be:<br />
// 1) a dot-atom (strings separated by periods)<br />
// 2) a quoted string<br />
// 3) an obsolete format string (combination of the above)<br />
$arrLocalPortion = explode(&#8216;.&#8217;, $strLocalPortion);<br />
for ($i = 0, $max = sizeof($arrLocalPortion); $i &amp;lt; $max; $i++) {                  if (!preg_match(&#8216;.^(&#8216;                                 .    &#8216;([A-Za-z0-9!#$%&amp;amp;'*+/=?^_`{|}~-]&#8216;                                 .    &#8216;[A-Za-z0-9!#$%&amp;amp;'*+/=?^_`{|}~-]{0,63})&#8217;                                 .&#8217;|&#8217;                                 .    &#8216;(&#8220;[^\"]{0,62}&#8221;)&#8217;                                 .&#8217;)$.&#8217;                                 ,$arrLocalPortion[$i])) {                     return false;                 }             }             return true;         }         /**          * Checks email section after &#8220;@&#8221; symbol for validity          * @param   strDomainPortion     Text to be checked          * @return  True if domain portion is valid, false if not          */         protected function check_domain_portion($strDomainPortion) {             // Total domain can only be from 1 to 255 characters, inclusive             if (!$this-&amp;gt;check_text_length($strDomainPortion, 1, 255)) {<br />
return false;<br />
}<br />
// Check if domain is IP, possibly enclosed in square brackets.<br />
if (preg_match(&#8216;/^(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])&#8217;<br />
.&#8217;(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}$/&#8217;<br />
,$strDomainPortion) ||<br />
preg_match(&#8216;/^[(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])&#8217;<br />
.&#8217;(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}]$/&#8217;<br />
,$strDomainPortion)) {<br />
return true;<br />
} else {<br />
$arrDomainPortion = explode(&#8216;.&#8217;, $strDomainPortion);<br />
if (sizeof($arrDomainPortion) &amp;lt; 2) {<br />
return false; // Not enough parts to domain<br />
}<br />
for ($i = 0, $max = sizeof($arrDomainPortion); $i &amp;lt; $max; $i++) {                     // Each portion must be between 1 and 63 characters, inclusive                     if (!$this-&amp;gt;check_text_length($arrDomainPortion[$i], 1, 63)) {<br />
return false;<br />
}<br />
if (!preg_match(&#8216;/^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|&#8217;<br />
.&#8217;([A-Za-z0-9]+))$/&#8217;, $arrDomainPortion[$i])) {<br />
return false;<br />
}<br />
if ($i == $max &#8211; 1) { // TLD cannot be only numbers<br />
if (strlen(preg_replace(&#8216;/[0-9]/&#8217;, &#8221;, $arrDomainPortion[$i])) &amp;lt;= 0) {<br />
return false;<br />
}<br />
}<br />
}<br />
}<br />
return true;<br />
}</p>
<p>/**<br />
* Check given text length is between defined bounds<br />
* @param   strText     Text to be checked<br />
* @param   intMinimum  Minimum acceptable length<br />
* @param   intMaximum  Maximum acceptable length<br />
* @return  True if string is within bounds (inclusive), false if not<br />
*/<br />
protected function check_text_length($strText, $intMinimum, $intMaximum) {<br />
// Minimum and maximum are both inclusive<br />
$intTextLength = strlen($strText);<br />
if (($intTextLength &amp;lt; $intMinimum) || ($intTextLength &amp;gt; $intMaximum)) {<br />
return false;<br />
} else {<br />
return true;<br />
}<br />
}</p>
<p>}<br />
[/PHP]</p>
]]></content:encoded>
			<wfw:commentRss>http://www.coolgeex.com/php-email-address-validator/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

