<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Md Emran Hasan (phpfour)</title>
	
	<link>http://www.phpfour.com/blog</link>
	<description>Emran's sharing on web technologies</description>
	<pubDate>Sun, 17 May 2009 20:47:00 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/phpfour" type="application/rss+xml" /><item>
		<title>phpXperts ‘09 seminar</title>
		<link>http://feedproxy.google.com/~r/phpfour/~3/jZbcob-ezxY/</link>
		<comments>http://www.phpfour.com/blog/2009/05/phpxperts-09-seminar-becoming-a-php-ninja/#comments</comments>
		<pubDate>Sun, 17 May 2009 20:29:25 +0000</pubDate>
		<dc:creator>Emran Hasan</dc:creator>
		
		<category><![CDATA[Featured Articles]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[RBS]]></category>

		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[Workshop]]></category>

		<category><![CDATA[developer]]></category>

		<category><![CDATA[efficiency]]></category>

		<category><![CDATA[phpxperts]]></category>

		<category><![CDATA[seminar]]></category>

		<category><![CDATA[speech]]></category>

		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.phpfour.com/blog/?p=243</guid>
		<description><![CDATA[At last the phpXperts seminar on &#8220;Current Web Trends&#8221; have taken place and I was one of the speakers there. Among all the topics, mine was a bit suggestive and naturally a bit less exciting. I spoke about how to become a PHP ninja - what are the characteristics they posses, what are the tools [...]]]></description>
			<content:encoded><![CDATA[<p>At last the phpXperts seminar on &#8220;Current Web Trends&#8221; have taken place and I was one of the speakers there. Among all the topics, mine was a bit suggestive and naturally a bit less exciting. I spoke about how to become a PHP ninja - what are the characteristics they posses, what are the tools they use, what are the paths they follow etc. It&#8217;s actually a follow-up of one of my blog posts: &#8220;<a href="http://www.phpfour.com/blog/2008/10/become-kick-ass-php-ninja-from-newbie-guide-tips/">Becoming a kick-ass PHP ninja</a>&#8220;.</p>
<p>Here goes the slides:</p>
<div id="__ss_1448402" style="margin: 0pt auto; width: 425px; text-align: center;"><object width="425" height="355" data="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=becomingaphpninja-090517141544-phpapp01&amp;stripped_title=becoming-a-php-ninja" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=becomingaphpninja-090517141544-phpapp01&amp;stripped_title=becoming-a-php-ninja" /><param name="allowfullscreen" value="true" /></object></div>
<p>All the other slides, pictures, and videos are available <a href="http://slides.phpxperts.net/">here</a>.</p>
<p>Enjoy!</p>
]]><p><a href="http://www.phpfour.com/blog/?p=243">phpXperts ‘09 seminar</a> - <a href="http://www.phpfour.com/blog">Md Emran Hasan (phpfour)</a> </p></content:encoded>
			<wfw:commentRss>http://www.phpfour.com/blog/2009/05/phpxperts-09-seminar-becoming-a-php-ninja/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.phpfour.com/blog/2009/05/phpxperts-09-seminar-becoming-a-php-ninja/</feedburner:origLink></item>
		<item>
		<title>Using Twitter for sending server downtime alert</title>
		<link>http://feedproxy.google.com/~r/phpfour/~3/s5a4tSbd1lU/</link>
		<comments>http://www.phpfour.com/blog/2009/03/php-twitter-server-monitoring-curl-tips-rest-api/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 16:53:22 +0000</pubDate>
		<dc:creator>Emran Hasan</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[api]]></category>

		<category><![CDATA[application]]></category>

		<category><![CDATA[curl]]></category>

		<category><![CDATA[quick]]></category>

		<category><![CDATA[REST]]></category>

		<category><![CDATA[tips]]></category>

		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.phpfour.com/blog/?p=238</guid>
		<description><![CDATA[Today I&#8217;ve written this simple PHP script to alert me through Twitter whenever our company&#8217;s local server is down. The script is called by a cron every 5 mins in my central hosting. Without much babble, here goes the code (if you&#8217;re interested to know why I needed this, that&#8217;s at the bottom of the [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;ve written this simple PHP script to alert me through <a href="http://twitter.com">Twitter</a> whenever our company&#8217;s local server is down. The script is called by a cron every 5 mins in my central hosting. Without much babble, here goes the code (if you&#8217;re interested to know why I needed this, that&#8217;s at the bottom of the post):</p>
<pre class="brush: php">
&lt;?php

// Specify the target URL in your server
$targetUrl  = &#039;http://YOUR_SERVER_URL&#039;;

// Specify what the response is from the server
$targetText = &#039;Hello from Daredevil&#039;;

// We will be using cURL for fetching the content
$ch = curl_init();

// Set the params
curl_setopt($ch, CURLOPT_URL, $targetUrl);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Get the response
$response = curl_exec($ch);
curl_close($ch);

// Are things in right place ?
if ($response == $targetText) {
    die(&#039;Site is up and running!&#039;);
}

// Nope, so here are the sender&#039;s twitter info
$username = &#039;SENDER_TWITTER_USERNAME&#039;;
$password = &#039;SENDER_TWITTER_PASSWORD&#039;;

// Receiver&#039;s twitter username
$receiver = &#039;RECEIVER_TWITTER_USERNAME&#039;;

// Alert message to send
$message = &#039;Daredevil is not responding, please fix ASAP!&#039;;

// The Twitter API address (new direct message)
$url = &#039;http://twitter.com/direct_messages/new.json&#039;;

// We will be using cURL for this
$ch = curl_init();

// Set the params
curl_setopt($ch, CURLOPT_URL, &quot;$url&quot;);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, &quot;user=$receiver&amp;amp;text=$message&quot;);
curl_setopt($ch, CURLOPT_USERPWD, &quot;$username:$password&quot;);

// Send the request
$response = curl_exec($ch);
curl_close($ch);

// Success or failure
if (!empty($response)) {
    echo &#039;Recipient has been notified.&#039;;
} else {
    echo &#039;No response from twitter.&#039;;
}
</pre>
<p><strong>Why I needed this?</strong></p>
<p>Recently we have setup a server at our office for committing work to a local SVN repository and have the QA test our work whenever they are ready. We also have a staging server where we do SVN update from this repo. Now, for the last few days, I&#8217;ve found the local server to be off due to a few reasons - but every time I realized this at night when I am back home and can&#8217;t do anything to turn it on. So I thought about this Twitter alert which is sent to my cell phone immediately when the server goes offline.</p>
<p>Btw, if Twitter doesn&#8217;t send SMS to your country, don&#8217;t worry. Check out the excellent service at <a href="http://twe2.com/">Twe2</a> that I&#8217;ve been using for a couple days.</p>
<p>Cheers!</p>
]]><p><a href="http://www.phpfour.com/blog/?p=238">Using Twitter for sending server downtime alert</a> - <a href="http://www.phpfour.com/blog">Md Emran Hasan (phpfour)</a> </p></content:encoded>
			<wfw:commentRss>http://www.phpfour.com/blog/2009/03/php-twitter-server-monitoring-curl-tips-rest-api/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.phpfour.com/blog/2009/03/php-twitter-server-monitoring-curl-tips-rest-api/</feedburner:origLink></item>
		<item>
		<title>A Workshop on “Freelancing IT Jobs - How to Make Yourself Ready”</title>
		<link>http://feedproxy.google.com/~r/phpfour/~3/SRs2UVtcGVg/</link>
		<comments>http://www.phpfour.com/blog/2009/03/a-workshop-on-freelancing-it-jobs-how-to-make-yourself-ready/#comments</comments>
		<pubDate>Sat, 07 Mar 2009 18:48:14 +0000</pubDate>
		<dc:creator>Emran Hasan</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Workshop]]></category>

		<category><![CDATA[download]]></category>

		<category><![CDATA[freelancing]]></category>

		<guid isPermaLink="false">http://www.phpfour.com/blog/?p=225</guid>
		<description><![CDATA[Today I facilitated this workshop on Freelancing, organized by BDjobs.com. The primary focus of the workshop was to introduce the concept of freelancing to the attendee&#8217;s as well as to provide them with a general hands-on path on how to start freelancing. The total workshop covered a variety of sections starting from freelancing overview, freelance [...]]]></description>
			<content:encoded><![CDATA[<p>Today I facilitated this workshop on Freelancing, organized by <a href="http://training.bdjobs-server.com/">BDjobs.com</a>. The primary focus of the workshop was to introduce the concept of freelancing to the attendee&#8217;s as well as to provide them with a general hands-on path on how to start freelancing. The total workshop covered a variety of sections starting from freelancing overview, freelance site reviews, tips on building a professional profile, the bidding process, tips on successful bidding, client management techniques, payment pitfalls, payment methods, etc.</p>
<blockquote class="left"><p>You can download the presentation file here in two formats: <a title="Freelancing IT Jobs" href="http://www.phpfour.com/blog/downloads/FreelancingPDF">PDF</a> and <a title="Freelancing IT Jobs" href="http://www.phpfour.com/blog/downloads/FreelancingPPT">Powerpoint</a>.</p></blockquote>
<p>The full workshop description is provided below. If you&#8217;re interested in attending the next workshop on April, get in touch with <a href="http://training.bdjobs-server.com/">BDjobs.com</a>.</p>
<p><span id="more-225"></span></p>
<blockquote>
<p style="text-align: center;"><strong>Freelancing IT Jobs - How to Make Yourself Ready</strong></p>
<p>A freelancer is a person who pursues a profession without a long-term commitment to any particular employer. A freelancer provides some sort of service whether it is design, programming, content writing or almost any other occupation. The main difference is that a freelancer has many clients rather than one steady employer. Freelancers often charge by the hour, the day or the project and are effectively running a small business with their skill set as the star product.</p>
<p>Although you might be thinking that freelancing is simply a different kind of job, in fact it is running your own business. When you are a freelancer, you are a one-person business. At some point you might even expand to a larger operation by hiring staff. Or you could remain a freelancer permanently.</p>
<p>So, if you&#8217;re looking for the next major break in your career OR you&#8217;re a fresh graduate who wants to make a living OR you want to check what the thing freelancing is, this workshop will help you out.</p>
<p><span style="text-decoration: underline;">Contents of Training:</span></p>
<p><strong>Session One: Introduction to IT Freelancing</strong></p>
<p>1. Introduction</p>
<ul>
<li>What is freelancing?</li>
<li>Benefits of freelancing</li>
<li>Type of freelancing scope</li>
<li>Type of freelancing jobs</li>
</ul>
<p>2. The Basics</p>
<ul>
<li>Things you need to start freelancing</li>
<li>Popular freelancing websites</li>
<li>Early success factors</li>
<li>Preparing yourself</li>
</ul>
<p><strong>Session two: Successful Freelancing</strong></p>
<p>1. Getting Projects</p>
<ul>
<li>Signing up in freelancing sites</li>
<li>Building a good profile</li>
<li>Successful bidding</li>
<li>Project scope &amp; Timing</li>
<li>Project budget</li>
</ul>
<p>2. Working with Project</p>
<ul>
<li>Milestones and deadlines</li>
<li>Communication</li>
<li>Track progress</li>
</ul>
<p>3. Working with Clients</p>
<ul>
<li>Essential client skills</li>
<li>Professional Relationship</li>
<li>How to keep client happy</li>
</ul>
<p><strong>Session three: Payments and Others</strong></p>
<p>1. Getting Paid</p>
<ul>
<li>Status reports</li>
<li>Invoices</li>
<li>Payment methods</li>
<li>How to avoid payment pitfalls</li>
</ul>
<p>2. Questions &amp; Answers</p>
</blockquote>
]]><p><a href="http://www.phpfour.com/blog/?p=225">A Workshop on “Freelancing IT Jobs - How to Make Yourself Ready”</a> - <a href="http://www.phpfour.com/blog">Md Emran Hasan (phpfour)</a> </p></content:encoded>
			<wfw:commentRss>http://www.phpfour.com/blog/2009/03/a-workshop-on-freelancing-it-jobs-how-to-make-yourself-ready/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.phpfour.com/blog/2009/03/a-workshop-on-freelancing-it-jobs-how-to-make-yourself-ready/</feedburner:origLink></item>
		<item>
		<title>PHP Payment Library for Paypal, Authorize.net and 2Checkout (2CO)</title>
		<link>http://feedproxy.google.com/~r/phpfour/~3/UYvQxmui1ik/</link>
		<comments>http://www.phpfour.com/blog/2009/02/php-payment-gateway-library-for-paypal-authorizenet-and-2checkout/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 20:03:27 +0000</pubDate>
		<dc:creator>Emran Hasan</dc:creator>
		
		<category><![CDATA[Code Library]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[2checkout]]></category>

		<category><![CDATA[authorize.net]]></category>

		<category><![CDATA[class]]></category>

		<category><![CDATA[exciting]]></category>

		<category><![CDATA[gateway]]></category>

		<category><![CDATA[library]]></category>

		<category><![CDATA[paypal]]></category>

		<category><![CDATA[solution]]></category>

		<category><![CDATA[web]]></category>

		<category><![CDATA[wrapper]]></category>

		<guid isPermaLink="false">http://www.phpfour.com/blog/?p=207</guid>
		<description><![CDATA[If you are like me, whenever you need to work with a 3rd party API or a gateway, you&#8217;d first search in Google for a possible wrapper for it in PHP. When it comes to supporting payment gateways, you get bunch of libraries in the search results who are fundamentally different. Some of them are [...]]]></description>
			<content:encoded><![CDATA[<p>If you are like me, whenever you need to work with a 3rd party API or a gateway, you&#8217;d first search in Google for a possible wrapper for it in PHP. When it comes to supporting payment gateways, you get bunch of libraries in the search results who are fundamentally different. Some of them are old PHP 3/4 ones, some are new, some may need PEAR, etc.</p>
<p>As they were not required together in one single project, I used them whenever needed. But in one project, I needed them all. I thoughts it&#8217;s a chance and decided to stop using them and wrote my own ones where I can use the same methods for all the gateways.</p>
<p>So, here is an abstract PaymentGateway library which is being extended to be used for three popular payment gateways (<a href="http://www.paypal.com">Paypal</a>, <a href="http://www.authorize.net">Authorize.net</a>, and <a href="http://www.2checkout.com">2Checkout</a>) in order to provide you with a similar way of using them. Note that the libraries are for basic usage only and do not contain options for recurring payments. Without much babble, let&#8217;s see a few examples of how you can use them.</p>
<blockquote class="left"><p>You can straight-away download the <strong><a target="_blank" href="http://www.phpfour.com/blog/downloads/payment" title="Download payment.zip">package</a></strong> with all the libraries, examples, and readme.</p></blockquote>
<p><strong>Paypal</strong></p>
<p>In order to process payments using Paypal, you&#8217;ll need to follow these steps:</p>
<p>1. Send the required information to Paypal (snippet 1). Be sure to specify your Paypal email where you want to receive the funds, the success and failure pages, the IPN page, and the product information. The example has the test mode ON, which you will not need in real scenario.</p>
<p>2. Create a payment success page where Paypal will send your customer after payment.</p>
<p>3. Create a payment failure page where Paypal will send your customer after failed payment.</p>
<p>4. Create a IPN page where Paypal will send payment notification in the background. Make sure you use/remove the test mode in conjunction with step 1. (snippet 2)</p>
<pre class="brush: php">
&lt;?php

// Include the paypal library
include_once (&#039;Paypal.php&#039;);

// Create an instance of the paypal library
$myPaypal = new Paypal();

// Specify your paypal email
$myPaypal-&gt;addField(&#039;business&#039;, &#039;YOUR_PAYPAL_EMAIL&#039;);

// Specify the currency
$myPaypal-&gt;addField(&#039;currency_code&#039;, &#039;USD&#039;);

// Specify the url where paypal will send the user on success/failure
$myPaypal-&gt;addField(&#039;return&#039;, &#039;http://YOUR_HOST/payment/paypal_success.php&#039;);
$myPaypal-&gt;addField(&#039;cancel_return&#039;, &#039;http://YOUR_HOST/payment/paypal_failure.php&#039;);

// Specify the url where paypal will send the IPN
$myPaypal-&gt;addField(&#039;notify_url&#039;, &#039;http://YOUR_HOST/payment/paypal_ipn.php&#039;);

// Specify the product information
$myPaypal-&gt;addField(&#039;item_name&#039;, &#039;T-Shirt&#039;);
$myPaypal-&gt;addField(&#039;amount&#039;, &#039;9.99&#039;);
$myPaypal-&gt;addField(&#039;item_number&#039;, &#039;001&#039;);

// Specify any custom value
$myPaypal-&gt;addField(&#039;custom&#039;, &#039;muri-khao&#039;);

// Enable test mode if needed
$myPaypal-&gt;enableTestMode();

// Let&#039;s start the train!
$myPaypal-&gt;submitPayment();
</pre>
<p><em>Snippet 1</em><br />
<span id="more-207"></span></p>
<pre class="brush: php">

&lt;?php

// Include the paypal library
include_once (&#039;Paypal.php&#039;);

// Create an instance of the paypal library
$myPaypal = new Paypal();

// Log the IPN results
$myPaypal-&gt;ipnLog = TRUE;

// Enable test mode if needed
$myPaypal-&gt;enableTestMode();

// Check validity and write down it
if ($myPaypal-&gt;validateIpn())
{
    if ($myPaypal-&gt;ipnData[&#039;payment_status&#039;] == &#039;Completed&#039;)
    {
         file_put_contents(&#039;paypal.txt&#039;, &#039;SUCCESS&#039;);
    }
    else
    {
         file_put_contents(&#039;paypal.txt&#039;, &quot;FAILURE\n\n&quot; . $myPaypal-&gt;ipnData);
    }
}
</pre>
<p><em>Snippet 2</em></p>
<p><strong>Authorize.net</strong></p>
<p>In order to process payments using Authorize.net, you&#8217;ll need to follow these steps:</p>
<p>1. Send the required information to Authorize.net(snippet 3). Be sure to specify your Authorize.net login and secret key, the success/failure pages, the IPN page, and the product information. The example has the test mode ON, which you will not need in real scenario.</p>
<p>2. Create a payment success/failure page where Authorize.net will send your customer after payment.</p>
<p>3. Create a IPN page where Authorize.net will send payment notification in the background. Make sure you use/remove the test mode in conjunction with step 1. (snippet 4)</p>
<p>4. In order to set the secret key, log into your authorize.net merchant account. Go to &#8220;MD5 Hash&#8221; menu and set a secret word to desired values and use that in the &#8220;setUserInfo&#8221; function showed in the example.</p>
<pre class="brush: php">
&lt;?php

// Include the paypal library
include_once (&#039;Authorize.php&#039;);

// Create an instance of the authorize.net library
$myAuthorize = new Authorize();

// Specify your authorize.net login and secret
$myAuthorize-&gt;setUserInfo(&#039;YOUR_LOGIN&#039;, &#039;YOUR_SECRET_KEY&#039;);

// Specify the url where authorize.net will send the user on success/failure
$myAuthorize-&gt;addField(&#039;x_Receipt_Link_URL&#039;, &#039;http://YOUR_HOST/payment/authorize_success.php&#039;);

// Specify the url where authorize.net will send the IPN
$myAuthorize-&gt;addField(&#039;x_Relay_URL&#039;, &#039;http://YOUR_HOST/payment/authorize_ipn.php&#039;);

// Specify the product information
$myAuthorize-&gt;addField(&#039;x_Description&#039;, &#039;T-Shirt&#039;);
$myAuthorize-&gt;addField(&#039;x_Amount&#039;, &#039;9.99&#039;);
$myAuthorize-&gt;addField(&#039;x_Invoice_num&#039;, rand(1, 100));
$myAuthorize-&gt;addField(&#039;x_Cust_ID&#039;, &#039;muri-khao&#039;);

// Enable test mode if needed
$myAuthorize-&gt;enableTestMode();

// Let&#039;s start the train!
$myAuthorize-&gt;submitPayment();
</pre>
<p><em>Snippet 3</em></p>
<pre class="brush: php">

&lt;?php

// Include the paypal library
include_once (&#039;Authorize.php&#039;);

// Create an instance of the authorize.net library
$myAuthorize = new Authorize();

// Log the IPN results
$myAuthorize-&gt;ipnLog = TRUE;

// Specify your authorize login and secret
$myAuthorize-&gt;setUserInfo(&#039;YOUR_LOGIN&#039;, &#039;YOUR_SECRET_KEY&#039;);

// Enable test mode if needed
$myAuthorize-&gt;enableTestMode();

// Check validity and write down it
if ($myAuthorize-&gt;validateIpn())
{
    file_put_contents(&#039;authorize.txt&#039;, &#039;SUCCESS&#039;);
}
else
{
    file_put_contents(&#039;authorize.txt&#039;, &quot;FAILURE\n\n&quot; . $myPaypal-&gt;ipnData);
}
</pre>
<p><em>Snippet 4</em></p>
<p><strong>2Checkout</strong></p>
<p>In order to process payments using 2Checkout, you&#8217;ll need to follow these steps:</p>
<p>1. Send the required information to 2Checkout(snippet 5). Be sure to specify your 2Checkout vendor id, the return page, and the product information. Please note that 2Checkout does not send IPN in the background, so you will need to handle the payment data in the return page. The example has the test mode ON, which you will not need in real scenario. </p>
<p>2. Create a return page where 2Checkout will send your customer after payment. This is also where you will need to retrieve and use the payment data. Make sure you use/remove the test mode in conjunction with step 1. (snippet 6)</p>
<p>3. In order to set the secret key, log into your 2checkout.com account and go to &#8220;Look and Feel&#8221; section. At the bottom enter the &#8220;Secret Word&#8221; and use it in the IPN verification process as shown in the example.</p>
<pre class="brush: php">
&lt;?php

// Include the paypal library
include_once (&#039;TwoCo.php&#039;);

// Create an instance of the authorize.net library
$my2CO = new TwoCo();

// Specify your 2CheckOut vendor id
$my2CO-&gt;addField(&#039;sid&#039;, &#039;YOUR_VENDOR_ID&#039;);

// Specify the order information
$my2CO-&gt;addField(&#039;cart_order_id&#039;, rand(1, 100));
$my2CO-&gt;addField(&#039;total&#039;, &#039;9.99&#039;);

// Specify the url where authorize.net will send the IPN
$my2CO-&gt;addField(&#039;x_Receipt_Link_URL&#039;, &#039;http://YOUR_HOST/payment/twoco_ipn.php&#039;);
$my2CO-&gt;addField(&#039;tco_currency&#039;, &#039;USD&#039;);
$my2CO-&gt;addField(&#039;custom&#039;, &#039;muri-khao&#039;);

// Enable test mode if needed
$my2CO-&gt;enableTestMode();

// Let&#039;s start the train!
$my2CO-&gt;submitPayment();
</pre>
<p><em>Snippet 5</em></p>
<pre class="brush: php">

&lt;?php

// Include the paypal library
include_once (&#039;TwoCo.php&#039;);

// Create an instance of the authorize.net library
$my2CO = new TwoCo();

// Log the IPN results
$my2CO-&gt;ipnLog = TRUE;

// Specify your authorize login and secret
$my2CO-&gt;setSecret(&#039;YOUR_SECRET_KEY&#039;);

// Enable test mode if needed
$my2CO-&gt;enableTestMode();

// Check validity and write down it
if ($my2CO-&gt;validateIpn())
{
    file_put_contents(&#039;2co.txt&#039;, &#039;SUCCESS&#039;);
}
else
{
    file_put_contents(&#039;2co.txt&#039;, &quot;FAILURE\n\n&quot; . $my2CO-&gt;ipnData);
}
</pre>
<p><em>Snippet 6</em></p>
<p>Hope this will help you integrate the payment gateways in an easy manner. If you have any questions, or find any bug, have a suggestion, feel free to post them as comment here. Btw, this library is released under the MIT license.</p>
<p><strong>Cheers!</strong></p>
<h3>Download</h3>
<table cellspacing="0" cellpadding="2" border="0" width="698">
<tbody>
<tr>
<td width="42"><a target="_blank" href="http://www.phpfour.com/blog/downloads/payment" title="Download payment.zip"><img src="http://www.phpfour.com/images/download.gif" border="0" /></a></td>
<td width="650"><strong>payment.zip</strong><br/>PHP Payment Library for Paypal, Authorize.net and 2Checkout<br/>Downloaded: <strong>2551</strong> times</td>
</tr>
</tbody>
</table>
]]><p><a href="http://www.phpfour.com/blog/?p=207">PHP Payment Library for Paypal, Authorize.net and 2Checkout (2CO)</a> - <a href="http://www.phpfour.com/blog">Md Emran Hasan (phpfour)</a> </p></content:encoded>
			<wfw:commentRss>http://www.phpfour.com/blog/2009/02/php-payment-gateway-library-for-paypal-authorizenet-and-2checkout/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.phpfour.com/blog/2009/02/php-payment-gateway-library-for-paypal-authorizenet-and-2checkout/</feedburner:origLink></item>
		<item>
		<title>Seven Things</title>
		<link>http://feedproxy.google.com/~r/phpfour/~3/OpNzhFmoy2I/</link>
		<comments>http://www.phpfour.com/blog/2009/02/seven-things/#comments</comments>
		<pubDate>Fri, 20 Feb 2009 21:16:16 +0000</pubDate>
		<dc:creator>Emran Hasan</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Random]]></category>

		<category><![CDATA[life]]></category>

		<category><![CDATA[seven]]></category>

		<category><![CDATA[strange]]></category>

		<category><![CDATA[things]]></category>

		<category><![CDATA[weird]]></category>

		<guid isPermaLink="false">http://www.phpfour.com/blog/?p=204</guid>
		<description><![CDATA[Well, this seven unknown things internet meme has been circulating in the web for a while and I am joining after seeing this in a few blogs I follow. However, haven&#8217;t seen this in my blogger network from Bangladesh so hope it will make a few laughs.
So here goes seven random (weird) things about me:
1. [...]]]></description>
			<content:encoded><![CDATA[<p>Well, this <a href="http://shiflett.org/blog/2009/jan/seven-things">seven</a> <a href="http://elizabethmariesmith.com/2009/01/seven-weird-things/">unknown</a> <a href="http://naramore.net/blog/seven-things">things</a> internet meme has been circulating in the web for a while and I am joining after seeing this in a few blogs I follow. However, haven&#8217;t seen this in my blogger network from Bangladesh so hope it will make a few laughs.</p>
<p>So here goes seven random (weird) things about me:</p>
<p>1. The veins in my left eyes are dried up, so I practically use my right eye for everything&#8230;pirate king!</p>
<p>2. The real break in my programming life came when I went to a programming contest with a team and was declined to participate. We had our rights and they later let us in, but gave us a almost broken PC. We cracked three out of 5 problems straight in DOS edit as the compiler would hardly run <img src='http://www.phpfour.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>3. I do not watch TV programs for the last 5 years. DVDs and downloaded movies/TV series are the only source of entertainment. My most fav TV series is <a href="http://en.wikipedia.org/wiki/X-Files">The X Files</a>.</p>
<p>4. When I was a kid, I was damn fond of toys. I had a whole collection of figures from HE-MAN, J.I.JOE, Thundercats, Transformers, and a few others. </p>
<p>5. I was present only in <strong>48% classes</strong> in my second year in college, whereas the rule of thumb was a minimum of <strong>85%</strong>. After the test exams, I was given a punishment of attending to library from 8am to 5pm for 26 days where the only thing allowed is study (textbook only). No friends, no gossip, no newspaper. </p>
<p>However, I convinced my father that this punishment was imposed to me as one teacher did not like my attitude in his class; i made my father to the principal with an application where its mentioned that I cannot attend this due to medical condition. Principal had to agree and I only had to do it for 2hrs for the sake of records <img src='http://www.phpfour.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>6. The first program I wrote for money was a file copying &#038; renaming program in VB6 for $20. It would transfer some old mail server (don&#8217;t rem the name) files from an old server to a new one and would rename their extension to match Microsoft Exchange. Exchange was smart enough to read &#038; convert automatically, so it looked as if the program did the conversion. Heh heh.</p>
<p>The fun part is, later another company was somehow convinced that it&#8217;s a huge work and went into a partnership with me where I received a down payment of $1500 and a 30% profit sharing with the same application plus a few UI improvement. Not bad <img src='http://www.phpfour.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>7. I never studied Computer Science nor did any programming classes. I have been in business studies concentration since school and did my bachelors in Business Administration (BBA). Currently I&#8217;m pursuing my masters in Business Administration (MBA) as well.</p>
<p>Here are the seven people I&#8217;m tagging:</p>
<p>1. <a href="http://hasin.wordpress.com">Hasin Hayder</a><br />
2. <a href="http://ajaxray.com">Anis Uddin Ahmad</a><br />
3. <a href="http://hasan.we4tech.com">NHM Tanveer Hossain Khan</a><br />
4. <a href="http://omi.net.bd">Omi Azad</a><br />
5. <a href="http://www.trivuz.com">Trivuz</a><br />
6. <a href="http://www.fanphp.com/">M.M.H Masud</a><br />
7. <a href="http://www.suhreedsarkar.com/">Suhreed Sarkar</a></p>
<p>And here goes the rules:</p>
<p>- Link your original tagger(s), and list these rules on your blog.<br />
- Share seven facts about yourself in the post - some random, some weird.<br />
- Tag seven people at the end of your post by leaving their names and the links to their blogs.<br />
- Let them know they&#8217;ve been tagged by leaving a comment on their blogs and/or Twitter.</p>
<p>Enjoy!</p>
]]><p><a href="http://www.phpfour.com/blog/?p=204">Seven Things</a> - <a href="http://www.phpfour.com/blog">Md Emran Hasan (phpfour)</a> </p></content:encoded>
			<wfw:commentRss>http://www.phpfour.com/blog/2009/02/seven-things/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.phpfour.com/blog/2009/02/seven-things/</feedburner:origLink></item>
		<item>
		<title>Code Updates (HTTP class, Extended CodeIgniter Model, Cross-domain AJAX transport)</title>
		<link>http://feedproxy.google.com/~r/phpfour/~3/ZiF-7AMCCwI/</link>
		<comments>http://www.phpfour.com/blog/2009/02/updated-http-class-extended-model-codeigniter-cross-domain-ajax-php/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 21:27:47 +0000</pubDate>
		<dc:creator>Emran Hasan</dc:creator>
		
		<category><![CDATA[Code Igniter]]></category>

		<category><![CDATA[General]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[ajax]]></category>

		<category><![CDATA[class]]></category>

		<category><![CDATA[cross-domain]]></category>

		<category><![CDATA[curl]]></category>

		<category><![CDATA[essential]]></category>

		<category><![CDATA[library]]></category>

		<category><![CDATA[update]]></category>

		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.phpfour.com/blog/?p=186</guid>
		<description><![CDATA[Greetings to all the readers of my blog. 
Many of you have been writing to me in the last couple days when I took the site down. The main objective was to add the new theme and push a few code updates of the existing libraries. I really appreciate your concern and would like to [...]]]></description>
			<content:encoded><![CDATA[<p>Greetings to all the readers of my blog. </p>
<p>Many of you have been writing to me in the last couple days when I took the site down. The main objective was to add the new theme and push a few code updates of the existing libraries. I really appreciate your concern and would like to reassure you that the site is up and will be up as usual <img src='http://www.phpfour.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Now, besides the slightly customized theme from Elegant Themes, I have put a few code updates. They are detailed below:</p>
<h3>Extended Model for CodeIgniter</h3>
<p>The <a href="http://www.phpfour.com/blog/2008/07/extended-model-for-codeigniter/">original version</a> of the Extended Model for CodeIgniter has been serving many people well. Although most users loved the nifty functions of the Model, many (including me) didn&#8217;t like the hacking of CI core to get this functionality. With the release of CodeIgniter 1.7, we can avoid that as we can now overload the Model class of CI like the other libraries. Follow this instruction:</p>
<p>1. Download the updated version from <a href="http://www.phpfour.com/blog/downloads/model-ci-2">here</a><br />
2. Put it in your application/libraries folder<br />
3. In your model files, use it this way: <strong>class Product extends MY_Model</strong><br />
4. Everything else is same just like the <a href="http://www.phpfour.com/blog/2008/07/extended-model-for-codeigniter/">original</a> one</p>
<h3>HTTP Class</h3>
<p>There is not much update in this class except for a few bug fixes (thanks to you guys). Also, I have included a license file in the package as many of you have asked. It&#8217;s released under the MIT license. The original post is <a href="http://www.phpfour.com/blog/2008/01/php-http-class/">here</a> for reference. </p>
<p>Download the update from <a href="http://www.phpfour.com/blog/downloads/http-class">here</a> and the API reference is <a href="http://www.phpfour.com/lib/http">here</a>.</p>
<h3>Cross-domain AJAX calls using PHP</h3>
<p>A minor bug fix in the code. Thanks to a few of you who pointed them out. Original post is <a href="http://www.phpfour.com/blog/2008/03/cross-domain-ajax-using-php/">here</a>. Download the update from <a href="http://www.phpfour.com/blog/downloads/transport">here</a>.</p>
<p>I have accelerated plans for the blog in 2009 so stay tuned for some worthy posts in this month. And do <a href="http://www.phpfour.com/blog/contact-me/">write to me</a> if you feel you have any questions/ideas/suggestions.</p>
<p>Cheers!</p>
]]><p><a href="http://www.phpfour.com/blog/?p=186">Code Updates (HTTP class, Extended CodeIgniter Model, Cross-domain AJAX transport)</a> - <a href="http://www.phpfour.com/blog">Md Emran Hasan (phpfour)</a> </p></content:encoded>
			<wfw:commentRss>http://www.phpfour.com/blog/2009/02/updated-http-class-extended-model-codeigniter-cross-domain-ajax-php/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.phpfour.com/blog/2009/02/updated-http-class-extended-model-codeigniter-cross-domain-ajax-php/</feedburner:origLink></item>
		<item>
		<title>Nokia N81 8GB</title>
		<link>http://feedproxy.google.com/~r/phpfour/~3/0XzsC68rS1w/</link>
		<comments>http://www.phpfour.com/blog/2008/12/nokia-n81-8gb-mobile-phone/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 13:39:54 +0000</pubDate>
		<dc:creator>Emran Hasan</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Mobile phone]]></category>

		<category><![CDATA[exciting]]></category>

		<category><![CDATA[mobile]]></category>

		<category><![CDATA[n81]]></category>

		<category><![CDATA[nokia]]></category>

		<category><![CDATA[nseries]]></category>

		<guid isPermaLink="false">http://www.phpfour.com/blog/?p=178</guid>
		<description><![CDATA[Today I bought a Nokia N81 8GB smartphone from my friend Nesar. This is an upgrade from my previous Nokia 6300, which I&#8217;ve been using for 1.5 year (thats the longest time I&#8217;ve used one model). The Nseries of Nokia has been attracting a lot of people lately, with their great music and photo capture [...]]]></description>
			<content:encoded><![CDATA[<p>Today I bought a <strong>Nokia N81 8GB</strong> smartphone from my friend Nesar. This is an upgrade from my previous <a title="Nokia 6300" href="http://www.phpfour.com/blog/2007/08/11/nokia-6300/" target="_blank">Nokia 6300</a>, which I&#8217;ve been using for 1.5 year (thats the longest time I&#8217;ve used one model). The <em>Nseries</em> of Nokia has been attracting a lot of people lately, with their great music and photo capture features. One of my colleagues, <a href="http://www.ajaxray.com">Anis</a>, also bought <a title="Anis N73 photos" href="http://www.flickr.com/photos/anis_niit" target="_blank">N73</a> just two months back.</p>
<p style="text-align: center;"><a href="http://www.phpfour.com/blog/wp-content/uploads/2008/12/nokia-n81.jpg"><img class="aligncenter size-full wp-image-179" title="Nokia N81 8GB" src="http://www.phpfour.com/blog/wp-content/uploads/2008/12/nokia-n81.jpg" alt="Nokia N81 8GB" width="536" height="456" /></a><br /><strong>Nokia N81 8GB</strong></p>
<p>Now, good points first. The N81boosts an extremely loud set of sterio speakers - combined with its Music Express, it delivers the highest quality of music I&#8217;ve ever purchased. Combined with the built-in FM radion, the dedicated music keys, and a multimedia menu - this is a <strong>music powerhouse</strong>, thanks to the all new Symbian 9.3 OS.</p>
<p>The Symbian OS is superb with all the applications and now has some stunning gameplay capabilities. The phone also has all kind of connectivity point you might need - GPRS, EDGE, Wifi, Bluetooth, WLAN, 3G. And don&#8217;t forget the built-in 8GB memory.</p>
<p>The only downside of this phone is the camera. It&#8217;s a 2 megapixel camera - which I don&#8217;t have any clue how got into a Nseries phone. If there is not enough light, the pictures are somewhat blurry. It has flash and a number of picture modes, so its a decent one - but nowhere in comparison with other Nseries 3.2mp and 5mp cameras.</p>
<p>All in all, here are the facts:</p>
<ul>
<li>2.4” QVGA main color display (320 x 240 pixels), up to 16.7 million colors</li>
<li>S60 3rd Edition Feature Pack 1 based on Symbian OS v9.2</li>
<li>Dedicated media keys for quick and easy access to music and video</li>
<li>WLAN IEEE802.11 b/g with UPnP (Universal Plug and Play) support</li>
<li>Bluetooth Specification 2.0 (profiles supported: DUN, OPP, FTP, HFP, GOEP, GAP, SPP, HSP, BIP, A2DP)</li>
<li>Micro USB 2.0 Full Speed (mass storage class)</li>
<li>Nokia AV Connector 3.5mm</li>
<li>Up to 2 megapixel (1600&#215;1200 pixels) camera, MPEG-4 VGA video capture of up to 15fps</li>
<li>Zoom: digital up to 20x</li>
<li>Front camera (CIF)</li>
<li>Video call and video sharing support (WCDMA network services)</li>
<li>Integrated flash (modes: on, off, automatic, redeye reduction)</li>
<li>Rotating gallery with Navi wheel support</li>
<li>Nokia Nseries digital music player supports MP3 (VBR), AAC, eAAC+, AAC+, WMA/M4A, WAV</li>
<li>OMA DRM 1.x, 2.0, Windows Media DRM (OTI/OTA with Nokia Music Store*)</li>
<li>Synchronize music with Windows Media Player 11</li>
<li>Media keys (play/pause, stop, forward, rewind)</li>
<li>Stereo FM radio (87.5-108MHz /76-90MHz)</li>
</ul>
<p>Let&#8217;s see how long it can serve my ever-growing thirst of technology <img src='http://www.phpfour.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]><p><a href="http://www.phpfour.com/blog/?p=178">Nokia N81 8GB</a> - <a href="http://www.phpfour.com/blog">Md Emran Hasan (phpfour)</a> </p></content:encoded>
			<wfw:commentRss>http://www.phpfour.com/blog/2008/12/nokia-n81-8gb-mobile-phone/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.phpfour.com/blog/2008/12/nokia-n81-8gb-mobile-phone/</feedburner:origLink></item>
		<item>
		<title>Preview release of Prothom Alo Blog</title>
		<link>http://feedproxy.google.com/~r/phpfour/~3/9_t_Ys6pGKg/</link>
		<comments>http://www.phpfour.com/blog/2008/10/preview-release-of-prothom-alo-blog/#comments</comments>
		<pubDate>Sat, 25 Oct 2008 21:07:07 +0000</pubDate>
		<dc:creator>Emran Hasan</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[Website Review]]></category>

		<category><![CDATA[blog]]></category>

		<category><![CDATA[community]]></category>

		<category><![CDATA[exciting]]></category>

		<category><![CDATA[platform]]></category>

		<category><![CDATA[prothom-alo]]></category>

		<guid isPermaLink="false">http://www.phpfour.com/blog/?p=171</guid>
		<description><![CDATA[
It&#8217;s my greatest pleasure to introduce another social community of Bangladesh, Prothom Alo Blog, to you all. The site has been made public for a beta period on Friday, 24th October, 2008. And it is expected to be fully released in public on the first week of November.
Me and Hasin has been working on it [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://prothom-aloblog.com/users/base/emran"><img class="aligncenter size-full wp-image-172" title="Prothom Alo Blog" src="http://www.phpfour.com/blog/wp-content/uploads/2008/10/palo.png" alt="Prothom Alo Blog" width="560" /></a></p>
<p>It&#8217;s my greatest pleasure to introduce another social community of Bangladesh, <a href="http://prothom-aloblog.com"><strong>Prothom Alo Blog</strong></a>, to you all. The site has been made public for a beta period on Friday, 24th October, 2008. And it is expected to be fully released in public on the first week of November.</p>
<p>Me and <a href="http://hasin.wordpress.com">Hasin</a> has been working on it for a couple month, with occasional help from <a title="ajaXray" href="http://www.ajaxray.com" target="_blank">Anis</a> and <a title="A tale of Valentica" href="http://blog.valenticabd.com/" target="_blank">Jahed</a>. We&#8217;ve tried all our means to make it as user-friendly as possible, without sacrificing functionality and robustness. The blog platform hosts most of the major features of a community blogging platform, along with a few key features which are unavailable in other similar platforms in Bangla.</p>
<p>The site is fully <strong>Unicode</strong> based, with support for embedded eot font for Internet Explorer. AJAX has been used spontaneously throughout the site to decrease initial load time of primary contents, and slowly fetching secondary contents. All the sidebars of the main pages and admin panels are <strong>widget ready</strong> and hosts a number of widgets as of now. In future, users will be able to add their widgets as well.</p>
<p>In this platform, we have separated the main site and the administration panel for users. This helps the bloggers as they get a centralized panel where they can mange their posts/comments/links/feeds/moderation/profile etc easily.</p>
<p>Besides the common functionality of community blog, the platform is different in one major context: <strong>Moderation</strong>. The content from the user&#8217;s blogs won&#8217;t be moderated. In order to allow this freedom, it&#8217;s been decided that no post will appear in front-page of main site categories, until promoted by the moderators. The aim is to provide a place where everybody has freedom of their own blog, but if they want to convey to others, they have to write in a way which actually adds value and abides by the common guideline.</p>
<p>Now that it&#8217;s open, we&#8217;d like everybody&#8217;s comments and suggestions for making it the largest social platform in Bangladesh. <span style="text-decoration: line-through;">Although the registration is closed right now, you can still get into it using an invitation code.</span> The site is OPEN now for public registration, <a title="Prothom Alo Blog" href="http://prothom-aloblog.com" target="_blank">go get one</a> <img src='http://www.phpfour.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Please send me an email or Contact me using the <a href="http://www.phpfour.com/blog/contact-me/">Contact page</a> if you need <span style="text-decoration: line-through;">an invitation</span> any information/help.</p>
<p>Thanks everybody!</p>
]]><p><a href="http://www.phpfour.com/blog/?p=171">Preview release of Prothom Alo Blog</a> - <a href="http://www.phpfour.com/blog">Md Emran Hasan (phpfour)</a> </p></content:encoded>
			<wfw:commentRss>http://www.phpfour.com/blog/2008/10/preview-release-of-prothom-alo-blog/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.phpfour.com/blog/2008/10/preview-release-of-prothom-alo-blog/</feedburner:origLink></item>
		<item>
		<title>Becoming a Kick-ass PHP ninja</title>
		<link>http://feedproxy.google.com/~r/phpfour/~3/Ra2aNC86T90/</link>
		<comments>http://www.phpfour.com/blog/2008/10/become-kick-ass-php-ninja-from-newbie-guide-tips/#comments</comments>
		<pubDate>Wed, 01 Oct 2008 21:35:53 +0000</pubDate>
		<dc:creator>Emran Hasan</dc:creator>
		
		<category><![CDATA[Cake PHP]]></category>

		<category><![CDATA[Code Igniter]]></category>

		<category><![CDATA[General]]></category>

		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[RBS]]></category>

		<category><![CDATA[Web Development]]></category>

		<category><![CDATA[developer]]></category>

		<category><![CDATA[employment]]></category>

		<category><![CDATA[essential]]></category>

		<category><![CDATA[guideline]]></category>

		<category><![CDATA[inspiration]]></category>

		<category><![CDATA[kick-ass]]></category>

		<category><![CDATA[php ninja]]></category>

		<category><![CDATA[productivity]]></category>

		<category><![CDATA[tips]]></category>

		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.phpfour.com/blog/?p=106</guid>
		<description><![CDATA[Who is this for?
You&#8217;ve been developing web applications using PHP for a couple months now and are finding it very enjoyable. Although you feel that you&#8217;re doing quite good, you&#8217;re not sure whether its the end. Besides, the following questions wonder you often:

Where to go from here
What new things to learn
How to become a Kick-ass [...]]]></description>
			<content:encoded><![CDATA[<h3>Who is this for?</h3>
<p>You&#8217;ve been developing web applications using PHP for a couple months now and are finding it very enjoyable. Although you feel that you&#8217;re doing quite good, you&#8217;re not sure whether its the end. Besides, the following questions wonder you often:</p>
<ul>
<li>Where to go from here</li>
<li>What new things to learn</li>
<li>How to become a Kick-ass PHP Ninja</li>
</ul>
<p>If that&#8217;s the scenario, then this post if for <strong>YOU</strong>.</p>
<h3>Background</h3>
<p>A few days back, I read a number of blog <a href="http://inter-sections.net/2007/11/13/how-to-recognise-a-good-programmer">posts</a> where people have highlighted the <a href="http://hasin.wordpress.com/2008/04/30/signs-you-are-ruining-your-career-as-a-web-app-developer/">shortcomings</a> they see in newbie developers. Some of them have gone further to narrow down the focus on <a href="http://www.boringguys.com/2008/05/20/beware-the-lone-wolf-php-developer/">PHP developers only</a> (as PHP&#8217;s nature sometimes allow developers to avoid standards). They did a great job by listing the shortcomings, but their posts missed clear way forwards (these can be inferred though). A number of readers also commented on the posts with their insight as well. So I was thinking how about compiling all these in an easy to follow list? Hence this post.</p>
<p>Btw, due to the volume, I&#8217;ve mostly touched the points here and provided few useful resource links for further study. I do have plan to elaborate a few of them in coming posts, with each point becoming a single post. Let me know which ones you&#8217;ll prefer most, by entering the poll at the bottom of the post.</p>
<h3>Part A : Technical Way Forward</h3>
<p>In the first part, let&#8217;s shed some light on how you can move forward with your technical abilities.</p>
<p><strong>1. Start using version control</strong></p>
<p>Version control is like a big UNDO button for your coding. You can go back to your previous code revisions and can compare/rollback to specific code areas anytime you see necessary. It will keep track of all your changes and will empower you to track your development changes across your work/team. Also, in a distributed development team, version control helps prevent overwriting of code by team members and keeps all the members code up to date.</p>
<p><a href="http://subversion.tigris.org">Subversion (SVN)</a> is one of the most popular open source version control system. If you&#8217;re on windows platform, you can try <a href="http://tortoisesvn.net">TortoiseSVN</a>, a client for SVN.</p>
<p><strong>2. Write code in OOP way</strong></p>
<p>If you haven&#8217;t already, it&#8217;s high time you started writing code in Object Oriented Programming (OOP) way. You may ask why? Well, OOP forces you to write code that is maintainable in nature. If properly followed, OOP code become a lot efficient than procedural code. Also, it allows you to re-use code across your project and/or multiple projects.</p>
<p>If you&#8217;re not convinced, have a <a href="http://www.phpdeveloper.org/news/5719">look</a> at <a href="http://www.php.net/oop">these</a> excellent <a href="http://www.killerphp.com/tutorials/object-oriented-php/">resources</a> for further study.</p>
<p><strong>3. Adhere to a coding standard</strong></p>
<p>Coding standards allow you to write code in a way which is easily understood by other people. When you adhere to a coding standard used by may others, you actually convey a message that you&#8217;re serious in writing code that people will be able to &#8220;get&#8221; and maintain. Keeping abbreviation type variable names, applying multiple indention types, writing meaningless function names etc will work for you in short term, maybe in personal projects. But when you move to a larger group with a number of developers, you ought to follow a standard so that everybody working with you can get along with your parts.</p>
<p>The following standards are most widely used among PHP developers around the globe:</p>
<ul>
<li><a href="http://pear.php.net/manual/en/standards.php">PEAR Coding Standards</a></li>
<li><a href="http://framework.zend.com/manual/en/coding-standard.html">Zend Framework Coding Standards</a></li>
<li><a href="http://ez.no/ezpublish/documentation/development/standards/php">eZ Publish PHP Coding Standards (depreciated)</a></li>
<li><a href="http://www.ezcomponents.org/contributing/coding_standards">eZ Components Implementation guidelines</a></li>
</ul>
<p>Although you can define a standard for your team/company, it&#8217;s always better to have close relation with what the industry follows. In my company, Right Brain Solution Ltd, we follow a slightly modified version of Zend Framework Coding Standards. You can get that one <a href="http://www.rightbrainsolution.com/php_coding_standard_rbs.pdf">here</a>.</p>
<p><strong>4. Document your code</strong></p>
<p>Documentation is a virtue of great developers - don&#8217;t get me wrong, I&#8217;m talking about code documentation, not writing user manuals <img src='http://www.phpfour.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> Well documented code prevents other team members from reading each line of your code and understand them by heart. Rather, it tells them exactly what they need to know - purpose of the code, what it requires as input, what it will deliver as output, etc. If you take a look at the above mentioned coding standards, you&#8217;ll discover that most of them even specified standard for documentation as well, which is <a href="http://www.phpdoc.org/">phpDocumentor</a>. It&#8217;s the most used standard for PHP code documentation and is widely recognized.</p>
<p><strong>5. Use a good framework</strong></p>
<p>Frameworks give you good structure and helps you build web applications in a fast way, with confidence. Most of today&#8217;s popular PHP frameworks (<a href="http://framework.zend.com/">Zend Framework</a>, <a href="http://www.codeigniter.com/">CodeIgniter</a>, <a href="http://cakephp.org/">CakePHP</a>, <a href="http://www.symfony-project.org">Symfony</a>, <a href="http://kohanaphp.com">Kohana</a> etc) follow the Model-View-Controller (MVC) pattern, which itself is a strong advocate of good practice.</p>
<p>Besides structure, frameworks force you to write code in a structured way. Some of them will also require writing the code in OOP - whose benefit we already discussed above. And frameworks usually come with a number of helpful libraries and helpers, to make your life easy as a web developer.</p>
<p>Josh sharp discusses this in details <a href="http://joshsharp.com.au/blog/view/why_you_should_be_using_a_framework">here </a>and later posts a follow-up <a href="http://joshsharp.com.au/blog/view/perhaps_the_world_doesnt_need_another_framework">here</a>. Both are good reads.</p>
<p><strong>6. Re-use code/libraries</strong></p>
<p>One of the most common advice programmers get is: &#8220;Don&#8217;t re-invent the wheel&#8221;. Well, what&#8217;s the point here? It actually means that you should not spend much time on solving a problem that has already been solved, in efficient way, by others. Rather solving it out yourself, you can &#8220;google&#8221; it and see how others have done it. It will not only save your valuable time, but also will ensure stable code (assuming that people usually post things on web after doing a number of testing and user of the codes usually help iron-out any issues, etc).</p>
<p>However, keep an eye on your target use/objective. If there is not enough good solutions that solves your problem, go ahead and solve yourself. Make it good and give it back to the community so that others facing that problem won&#8217;t need to spent the time you&#8217;ve spent. The whole open source model runs on this give-give way, so be a part of it.</p>
<p><strong>7. Test your code the right way</strong></p>
<p>In order to make confidence out of your code, you&#8217;ll need to test your code the right way. Although you might be used to testing your application using debug messages and browser refreshes, in a real world scenario these won&#8217;t work. You&#8217;ll need to write unit tests which can do automated testing of your code. The power lies in that you can run these tests almost anytime and can check if anything is broken after each new change.</p>
<p><a href="http://www.phpunit.de/">PHPUnit</a> and <a href="http://www.simpletest.org/">SimpleTest</a> are the two most widely used Unit testing suite for PHP. You should also have a look on <a href="http://en.wikipedia.org/wiki/Test-driven_development">Test Driven Development (TDD)</a>, which is the way of greatly enhancing your chance of deploying application with least bugs.</p>
<h3>Part B : Personal Way Forward</h3>
<p>Now, even if you&#8217;ve improved yourself on the above mentioned points, you&#8217;ll still need to work on your personal matters to move forward. Here goes those points.</p>
<p><strong>8. Be Agile</strong></p>
<p>You need to be an agile developer if you want to move forward in your career. What does it mean to be agile? Agility is more of an attitude than a skill set. The common characteristics of agile developers are:</p>
<ul>
<li>They’re open minded and therefore willing to learn new techniques</li>
<li>They’re responsible and therefore willing to seek the help of the right person(s) for the task at hand</li>
<li>They&#8217;re willing to work closely with others, pair programming or working in small teams as appropriate</li>
<li>They&#8217;re willing to work iteratively and incrementally</li>
</ul>
<p>Further resources: <a href="http://en.wikipedia.org/wiki/Agile_software_development">Agile Software Development</a>, <a href="http://agilemanifesto.org/">The Agile Manifesto</a>.</p>
<p><strong>9. Keep yourself updated</strong></p>
<p>No matter what, keep yourself updated on whats going on in your field (in this case PHP). Subscribe to the RSS of great PHP blogs and skim over them on a regular basis. Dig into the topics that interest you most and see the author&#8217;s point. Also, keep a habit of trying new technologies every now &#038; then. It gives you an edge over others and when any discussion goes about it, you can help others understand as well as make your points.</p>
<p>Btw, if you don&#8217;t have a clue where to find good blogs, have a look at <a href="http://planet-php.org/">here</a>, <a href="http://hasin.wordpress.com/2007/07/12/list-of-rss-feeds-i-read-almost-everyday/">here</a> and <a href="http://godbit.com/article/reading-list">here</a>.</p>
<p><strong>10. Start community involvement</strong></p>
<p>Remember I told above to give your work back to the community ? How to do that ? <a href="http://wordpress.com/">Start a blog</a> of your own and start writing posts there every now &#038; then. Yes, I know you&#8217;d say &#8220;Who&#8217;s going to read my blog anyway?&#8221;, but if you share your experience, someday, somebody will find it useful. And if you can share things that others haven&#8217;t done, you&#8217;ll slowly see visitors coming on your blog increasing way.</p>
<p>Besides blog, try to participate in tech <a href="http://www.sitepoint.com/forums/">forums</a> and <a href="http://tech.groups.yahoo.com/group/phpexperts">communities</a>. Help people out in the areas you excel and at the time of your need, other people will be happy to help you out as well. These communities are also great place to learn about many unusual matters, see how situation changes from person to person, place to place, etc. You&#8217;ll also be able to make great friends who might come handy later in your life.</p>
<p>Another great way of community involvement is to contributing to <a href="https://www.ohloh.net/projects">open source projects</a>. Share some of your valuable time for an open source project and it may come handy for a huge number of people. Your work might solve the problem of somebody like you. If needed, <a href="http://www.orchidframework.com/">initiate</a> an open source project yourself and invite others to work on your vision.</p>
<p><strong>11. Use a good IDE</strong></p>
<p>With due respect to <a href="http://www.adobe.com/products/dreamweaver/">Dreamweaver</a>, step forward and use an IDE made for PHP. You&#8217;ll notice the difference in a few days when you&#8217;ll see that your productivity has increased in great ways. These IDEs provide great number of useful features including but not limited to: syntax highlighting, auto completion, code suggestions, code snippets, contextual help, code templates, debugging, profiling, etc.</p>
<p>The following IDEs mostly have the similar feature set and can boost your productivity in great ways:</p>
<ul>
<li><a href="http://www.nusphere.com/products/phped.htm">NuSphere PhpED</a></li>
<li><a href="http://www.mpsoftware.dk/">phpDesigner 2008</a></li>
<li><a href="http://www.zend.com/en/products/studio/">Zend Studio for Eclipse</a></li>
</ul>
<p>Personally I use <strong>NuSphere PhpED 5.2</strong> and I love it in every way. They&#8217;ve provided me with a complementary license and I am grateful to them for that. If you&#8217;re planning to buy it, let me know and I might find you a discount.</p>
<p><strong>12. Be communicative</strong></p>
<p>In your team/company, try to be as communicative as possible. It reduces a lot of confusions, makes you close to other devs so that you understand them, portrays you as a good person in front of management and overall, helps you enjoy your work. When you&#8217;re working together with others, make them feel that you&#8217;re there and ready to give whatever it takes. Create a personal brand of yourself.</p>
<h3>What&#8217;s next?</h3>
<p>Phew! It&#8217;s quite a good amount of writing in a while <img src='http://www.phpfour.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> I&#8217;ve tried to cover most of the items I found to be important. However, there might be some points I&#8217;ve overlooked so feel free to post them in the comments. If this helps any one of the developers I intend it for, then I&#8217;ll take that the effort is successful.</p>
<p>Thanks everybody, Happy Eid Mubarak to you!</p>
<div style="background-color: #EAF3FA;border: 1px solid #464646;">Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.</div>
]]><p><a href="http://www.phpfour.com/blog/?p=106">Becoming a Kick-ass PHP ninja</a> - <a href="http://www.phpfour.com/blog">Md Emran Hasan (phpfour)</a> </p></content:encoded>
			<wfw:commentRss>http://www.phpfour.com/blog/2008/10/become-kick-ass-php-ninja-from-newbie-guide-tips/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.phpfour.com/blog/2008/10/become-kick-ass-php-ninja-from-newbie-guide-tips/</feedburner:origLink></item>
		<item>
		<title>Increase productivity with Todoist</title>
		<link>http://feedproxy.google.com/~r/phpfour/~3/tTYWKKDKzig/</link>
		<comments>http://www.phpfour.com/blog/2008/09/increase-productivity-with-todoist/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 15:56:21 +0000</pubDate>
		<dc:creator>Emran Hasan</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Programming]]></category>

		<category><![CDATA[developer]]></category>

		<category><![CDATA[efficiency]]></category>

		<category><![CDATA[essentials]]></category>

		<category><![CDATA[productivity]]></category>

		<category><![CDATA[solution]]></category>

		<category><![CDATA[to do]]></category>

		<category><![CDATA[web 2.0]]></category>

		<category><![CDATA[work]]></category>

		<guid isPermaLink="false">http://www.phpfour.com/blog/?p=125</guid>
		<description><![CDATA[If you&#8217;re like me, you&#8217;d want to keep your ever busy life a bit organized. Being a techie, you&#8217;d first find a  tool that will facilitate you in doing so. Most of us are fan of a number of such tools: RememberTheMilk, BackPack, Ta-Da List, 30boxes, Microsoft OneNote, Stickies etc. I&#8217;ve also tried all [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re like me, you&#8217;d want to keep your ever busy life a bit organized. Being a techie, you&#8217;d first find a  tool that will facilitate you in doing so. Most of us are fan of a number of such tools: <a href="http://www.rememberthemilk.com/">RememberTheMilk</a>, <a href="http://www.backpackit.com">BackPack</a>, <a href="http://www.tadalist.com/">Ta-Da List</a>, <a href="http://www.30boxes.com/">30boxes</a>, <a href="http://office.microsoft.com/en-us/onenote/default.aspx">Microsoft OneNote</a>, <a href="http://www.zhornsoftware.co.uk/stickies/">Stickies </a>etc. I&#8217;ve also tried all of them and a few others, stuck with them for a few days, but later lost the interest. This happened until one of colleagues, <a href="http://www.ajaxray.com/">Anis</a>, suggested me to have a look on <strong><a href="http://todoist.com">Todoist</a></strong>.</p>
<p>At first sight, I thought it as <em>&#8220;okay&#8230;another web 2.0 brainchild&#8221;</em>. It seemed too simple to handle my complicated needs and I did not have high ambition with it. But as days passed, I was discovering new new features of it and gradually it became a part of my life. I&#8217;m a big fan of <a href="http://www.amazon.com/exec/obidos/ASIN/0142000280/lowendmac00-20">Getting Things Done (GTD)</a> approach and Todoist became my dropbox for all the tasks in my mind.</p>
<p>If you ask me what&#8217;s so special about Todoist, I&#8217;d mention the following few features:</p>
<h3>Simplicity</h3>
<p>Todoist is damn simple and hosts one of the most powerful yet sleek web 2.0 interface on the web. It allows you to have an unlimited nested category/project list and under each of them, unlimited nested task list. This is something that most other tools miss. For me, it&#8217;s a super MUST feature.</p>
<p align="center"><a href="http://www.phpfour.com/blog/wp-content/uploads/2008/09/todoist_main.jpg"><img src="http://www.phpfour.com/blog/wp-content/uploads/2008/09/todoist_main.jpg" alt="" title="Todoist Main" width="620" height="312" class="aligncenter size-full wp-image-126" /></a></p>
<p><span id="more-125"></span></p>
<h3>Shortcuts</h3>
<p>I was never fond of using shortcuts in web apps, but Todoist has made me use it&#8217;s ones. With very simple and familiar shortcuts, you can easily perform the most used tasks in a flash. For example, you press <strong>a</strong> to add a new task, <strong>Ctrl+Left / Ctrl+Right</strong> to indent/outdent your task, <strong>Ctrl+Enter</strong> to save the current item and add a new one below, etc etc. When you get used to with them, you&#8217;ll find that you&#8217;re using them unconsciously.</p>
<p align="center"><a href="http://www.phpfour.com/blog/wp-content/uploads/2008/09/todoist_shortcuts.jpg"><img src="http://www.phpfour.com/blog/wp-content/uploads/2008/09/todoist_shortcuts.jpg" alt="" title="Todoist Shortcuts" width="500" height="312" class="aligncenter size-full wp-image-129" /></a></p>
<h3>Powerful Date</h3>
<p>Todoist features one of the most powerful date input system. It understands any natural date entry you can have: <strong>today, friday, next tuesday, tomorrow @ 5pm, last friday</strong>, etc. And it&#8217;s not limited to that only, you can add recurring dates in as simple way: <strong>ev day @1pm, every fri, every 2nd mon</strong>, etc.</p>
<p align="center"><a href="http://www.phpfour.com/blog/wp-content/uploads/2008/09/todoist_dates.jpg"><img src="http://www.phpfour.com/blog/wp-content/uploads/2008/09/todoist_dates.jpg" alt="" title="Todoist Dates" width="500" height="333" class="aligncenter size-full wp-image-130" /></a> </p>
<h3>Task Query</h3>
<p>So, you&#8217;ve added a bunch of tasks and now want to find out a small set of them. How do you do that? Simple, type the query in the Todoist query box at top left. Example: <strong>tod, tom, next 4 days, overdue, @meeting</strong>, etc. Btw, Todoist allows you to tag your tasks with a very simple manner. Just put a &#8220;@tag&#8221; in your task details and it will become a tag. You can later query using that tag as well.</p>
<p align="center"><a href="http://www.phpfour.com/blog/wp-content/uploads/2008/09/todoist_query.jpg"><img src="http://www.phpfour.com/blog/wp-content/uploads/2008/09/todoist_query.jpg" alt="" title="Todoist Query" width="223" height="153" class="aligncenter size-full wp-image-131" /></a></p>
<h3>Reminders</h3>
<p>Like all other similar applications, Todoist also features a number of reminder methods. You can plug in your jabber client, ask it to send you sms, or fire an email. Moreover, if you&#8217;re one of those twitter fans, then it can send msg to your twitter also. What more can someone need?</p>
<p align="center"><a href="http://www.phpfour.com/blog/wp-content/uploads/2008/09/todoist_reminders.jpg"><img src="http://www.phpfour.com/blog/wp-content/uploads/2008/09/todoist_reminders.jpg" alt="" title="Todoist Reminders" width="445" height="236" class="aligncenter size-full wp-image-132" /></a></p>
<h3>API</h3>
<p>Yes, I knew you&#8217;d ask about it. Todoist has a very simple yet powerful set of API functions that you can use to fetch the contents from your account. They return the data in JSON format so you can use it in your JavaScript based applications and also can use in any back-end applications as well by converting them as per your need. And it has a number of different plugins for <a href="http://todoist.com/Help/viewQuickSilver">QuickSilver</a>, <a href="http://todoist.com/Help/viewLaunchy">Launchy</a>, <a href="http://todoist.com/Help/viewDashboard">Mac Dashboard</a>, <a href="http://todoist.com/Help/viewWidget">iGoogle, Netvibes</a>, etc. And lastly, there is a <a href="http://todoist.com/Help/viewSidebar">Firefox sidebar</a> which integrates seamlessly into your firefox for a faster and smarter access to your tasks.</p>
<p align="center"><a href="http://www.phpfour.com/blog/wp-content/uploads/2008/09/todoist_api.jpg"><img src="http://www.phpfour.com/blog/wp-content/uploads/2008/09/todoist_api.jpg" alt="" title="Todoist API" width="500" height="244" class="aligncenter size-full wp-image-133" /></a></p>
<h3>Some missing functionality</h3>
<p>Although Todoist boosts an array of excellent features and satisfies all my needs in full, I&#8217;d love to have a few more features in it: <strong>Offline access (using Google Gear)</strong>, <strong>Export/Import of tasks</strong>, <strong>iCal/RSS</strong>, <strong>Google Calendar Integration</strong> etc. The best part is, they&#8217;ve opened a place to hear from the users and are willing to value the <a href="http://todoist.uservoice.com/">user&#8217;s voice</a>.</p>
<p>All in all, Todoist is my most favorite tool on the web at this moment. It helps me like a little buddy and keeps my life organized and clean. I&#8217;d ask you to give it a try and stick with it for a couple days and I am more than sure that you&#8217;ll find its beauty.</p>
<p>Happy tasking !</p>
]]><p><a href="http://www.phpfour.com/blog/?p=125">Increase productivity with Todoist</a> - <a href="http://www.phpfour.com/blog">Md Emran Hasan (phpfour)</a> </p></content:encoded>
			<wfw:commentRss>http://www.phpfour.com/blog/2008/09/increase-productivity-with-todoist/feed/</wfw:commentRss>
		<feedburner:origLink>http://www.phpfour.com/blog/2008/09/increase-productivity-with-todoist/</feedburner:origLink></item>
	</channel>
</rss>
