<?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>letsDoGoodCode &#187; PHP</title>
	<atom:link href="http://www.gangarasa.com/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gangarasa.com</link>
	<description>A WeBlog</description>
	<lastBuildDate>Mon, 16 Aug 2010 13:00:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Escape from Magic Quotes for Non-Frameworks Programmers</title>
		<link>http://www.gangarasa.com/2010/08/12/escape-from-magic-quotes-for-non-frameworks-programmers/</link>
		<comments>http://www.gangarasa.com/2010/08/12/escape-from-magic-quotes-for-non-frameworks-programmers/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 08:20:02 +0000</pubDate>
		<dc:creator>Gangarasa</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Magic Quotes]]></category>
		<category><![CDATA[magic_quotes_gpc]]></category>

		<guid isPermaLink="false">http://www.gangarasa.com/?p=39</guid>
		<description><![CDATA[Here is a quick thing to help you fetch clean data from GET POST COOKIE and REQUEST input variables. Of course, you need to rely on something like mysql_real_escape_string before writing this into a database. But a common function like &#8230; <a href="http://www.gangarasa.com/2010/08/12/escape-from-magic-quotes-for-non-frameworks-programmers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here is a quick thing to help you fetch clean data from <em>GET POST COOKIE</em> and <em>REQUEST</em> input variables. Of course, you need to rely on something like <em>mysql_real_escape_string</em> before writing this into a database. But a common function like this for the entire Web App will keep the data safe from slashes and helps you code without bothering whether <em>magic_quotes_gp</em>c is ON or OFF.</p>
<p><code><br />
/**<br />
 * Use this function to safely retreive data from GET POST COOKIE and REQUEST super globals<br />
 *<br />
 * @param String $_key Name of the POST element to be retrieved<br />
 * @return String Clean value without any slashes even if magic_quotes_gpc is enabled.<br />
 */<br />
function getFromGpc($_key, $_source='p')<br />
{<br />
    $_source = strtolower($_source);</p>
<p>    if( $_source == 'p' ):<br />
        if( get_magic_quotes_gpc() ) {<br />
            return stripslashes($_POST[$_key]);<br />
        } else {<br />
            return ($_POST[$_key]);<br />
        }<br />
    elseif( $_source == 'g' ):<br />
        if( get_magic_quotes_gpc() ) {<br />
            return stripslashes($_GET[$_key]);<br />
        } else {<br />
            return ($_GET[$_key]);<br />
        }<br />
    elseif( $_source == 'c' ):<br />
        if( get_magic_quotes_gpc() ) {<br />
            return stripslashes($_COOKIE[$_key]);<br />
        } else {<br />
            return ($_COOKIE[$_key]);<br />
        }<br />
    elseif( $_source == 'r' ):<br />
        if( get_magic_quotes_gpc() ) {<br />
            return stripslashes($_REQUEST[$_key]);<br />
        } else {<br />
            return ($_REQUEST[$_key]);<br />
        }<br />
    else:<br />
        if( get_magic_quotes_gpc() ) {<br />
            return stripslashes($_REQUEST[$_key]);<br />
        } else {<br />
            return ($_REQUEST[$_key]);<br />
        }<br />
    endif;<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gangarasa.com/2010/08/12/escape-from-magic-quotes-for-non-frameworks-programmers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>doxentral &#8211; A CodeIgniter based Web App.</title>
		<link>http://www.gangarasa.com/2010/06/01/doxentral-a-codeigniter-based-web-app/</link>
		<comments>http://www.gangarasa.com/2010/06/01/doxentral-a-codeigniter-based-web-app/#comments</comments>
		<pubDate>Tue, 01 Jun 2010 08:53:56 +0000</pubDate>
		<dc:creator>Gangarasa</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[ColorBox]]></category>
		<category><![CDATA[doxentral]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[SWFUpload]]></category>

		<guid isPermaLink="false">http://www.gangarasa.com/?p=33</guid>
		<description><![CDATA[New to CodeIgniter and looking for a example that helps you learn how a Model is written? or how form_valdiation library is used? and how to integrate SWFUpload? Here is a nice example: doxentral Useful links: CodeIgniter ColorBox jQuery Plugin &#8230; <a href="http://www.gangarasa.com/2010/06/01/doxentral-a-codeigniter-based-web-app/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>New to CodeIgniter and looking for a example that helps you learn how a Model is written? or how form_valdiation library is used? and how to integrate SWFUpload?</p>
<p>Here is a nice example:<br />
<a href="http://github.com/harvest/doxentral">doxentral</a></p>
<p>Useful links:<br />
<a href="http://codeigniter.com/">CodeIgniter</a><br />
<a href="http://colorpowered.com/colorbox/">ColorBox jQuery Plugin</a><br />
<a href="http://codeigniter.com/forums/viewthread/100098/#536121">Session class does not support a change of session ID (Facebook and Flash problem)</a><br />
<a href="http://www.swfupload.org/">SWFUpload</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gangarasa.com/2010/06/01/doxentral-a-codeigniter-based-web-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting Upload Max Size via .htaccess</title>
		<link>http://www.gangarasa.com/2010/01/25/setting-upload-max-size-via-htaccess/</link>
		<comments>http://www.gangarasa.com/2010/01/25/setting-upload-max-size-via-htaccess/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 11:58:25 +0000</pubDate>
		<dc:creator>Gangarasa</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[post_max_size]]></category>
		<category><![CDATA[upload_max_filesize]]></category>

		<guid isPermaLink="false">http://www.gangarasa.com/2010/01/25/setting-upload-max-size-via-htaccess/</guid>
		<description><![CDATA[Here is an example to allow File Uploads upto 2 GB. You may also have to consider Max Execution Time. PHP4: &#60;IfModule mod_php4.c&#62; php_value upload_max_filesize 2G php_value post_max_size 2G &#60;/IfModule&#62; PHP5: &#60;IfModule mod_php5.c&#62; php_value upload_max_filesize 2G php_value post_max_size 2G &#60;/IfModule&#62;]]></description>
			<content:encoded><![CDATA[<p>Here is an example to allow File Uploads upto 2 GB. You may also have to consider Max Execution Time.</p>
<p>PHP4:</p>
<p><code><br />
&lt;IfModule mod_php4.c&gt;</p>
<p>php_value upload_max_filesize 2G</p>
<p>php_value post_max_size 2G</p>
<p>&lt;/IfModule&gt;</code></p>
<p><code> </code></p>
<p>PHP5:</p>
<p><code><br />
&lt;IfModule mod_php5.c&gt;</p>
<p>php_value upload_max_filesize 2G</p>
<p>php_value post_max_size 2G</p>
<p>&lt;/IfModule&gt;</code></p>
<p><code> </code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gangarasa.com/2010/01/25/setting-upload-max-size-via-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML to PDF from PHP Made Easy!</title>
		<link>http://www.gangarasa.com/2009/05/04/html-to-pdf-from-php-made-easy/</link>
		<comments>http://www.gangarasa.com/2009/05/04/html-to-pdf-from-php-made-easy/#comments</comments>
		<pubDate>Mon, 04 May 2009 12:01:36 +0000</pubDate>
		<dc:creator>Gangarasa</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[dompdf]]></category>
		<category><![CDATA[FPDF]]></category>
		<category><![CDATA[HTML to PDF]]></category>

		<guid isPermaLink="false">http://www.gangarasa.com/2009/05/04/html-to-pdf-from-php-made-easy/</guid>
		<description><![CDATA[Finally, found two new Libraries that makes a PHP programmer&#8217;s life easy. Tested both and they seem to work pretty fine for simple requirements like PDF receipt generation or news letter download or e-Ticket/e-Cert generation. FPDF (PHP4 and PHP5) dompdf (PHP5 &#8230; <a href="http://www.gangarasa.com/2009/05/04/html-to-pdf-from-php-made-easy/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Finally, found two new Libraries that makes a PHP programmer&#8217;s life easy. Tested both and they seem to work pretty fine for simple requirements like PDF receipt generation or news letter download or e-Ticket/e-Cert generation.</p>
<p><a title="FPDF" href="http://www.fpdf.org/" target="_blank">FPDF</a> (PHP4 and PHP5)<br />
<a title="dompdf" href="http://www.digitaljunkies.ca/dompdf/about.php" target="_blank"> dompdf</a> (PHP5 Only)</p>
<p>Happy PDFing!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gangarasa.com/2009/05/04/html-to-pdf-from-php-made-easy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
