<?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>Kurinchi Blogger Scribbles ... &#187; PHP</title>
	<atom:link href="http://kurinchilamp.kurinchilion.com/tag/php/feed" rel="self" type="application/rss+xml" />
	<link>http://kurinchilamp.kurinchilion.com</link>
	<description>On Open Source Technologies</description>
	<lastBuildDate>Mon, 02 Jan 2012 06:14:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>PHP Excel reader</title>
		<link>http://kurinchilamp.kurinchilion.com/2011/01/php-excel-reader.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2011/01/php-excel-reader.html#comments</comments>
		<pubDate>Thu, 27 Jan 2011 00:11:59 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[excel reader]]></category>
		<category><![CDATA[new by reference]]></category>
		<category><![CDATA[php excel reader]]></category>
		<category><![CDATA[php xls reader]]></category>
		<category><![CDATA[split deprecated]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=879</guid>
		<description><![CDATA[php-excel-reader Parse and retrieve information from XLS files Download from Code Google When the excel reader is run on PHP 5.3, below mentioned deprecated warning messages gets shown. i) Assigning the return value of new by reference is deprecated Remove &#038; from the line below $this->_ole =&#038; new OLERead(); and have $this->_ole = new OLERead(); [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://code.google.com/p/php-excel-reader/" target="_blank">php-excel-reader</a> Parse and retrieve information from XLS files</p>
<p><a href="http://code.google.com/p/php-excel-reader/downloads/list" target="_blank">Download from Code Google</a></p>
<p>When the excel reader is run on <strong>PHP 5.3</strong>, below mentioned deprecated warning messages gets shown.</p>
<p><strong>i) Assigning the return value of new by reference is deprecated</strong></p>
<p>Remove &#038; from the line below</p>
<p><strong>$this->_ole =&#038; new OLERead();</strong></p>
<p>and have </p>
<p><strong>$this->_ole = new OLERead();</strong></p>
<p>instead.</p>
<p><strong>ii) Function split() is deprecated</strong></p>
<p>Function split() is deprecated and we can use explode() instead of that.</p>
<p><strong>$parts = split(&#8220;;&#8221;,$format); </strong></p>
<p>change it to</p>
<p><strong>$parts = explode(&#8220;;&#8221;,$format);</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2011/01/php-excel-reader.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: ‘Fatal error: Allowed memory size of 8388608 bytes exhausted’</title>
		<link>http://kurinchilamp.kurinchilion.com/2010/08/php-%e2%80%98fatal-error-allowed-memory-size-of-8388608-bytes-exhausted%e2%80%99.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2010/08/php-%e2%80%98fatal-error-allowed-memory-size-of-8388608-bytes-exhausted%e2%80%99.html#comments</comments>
		<pubDate>Tue, 03 Aug 2010 03:24:46 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[allowed memory exhaust]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[fatal error]]></category>
		<category><![CDATA[memory limit]]></category>
		<category><![CDATA[php.ini]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=869</guid>
		<description><![CDATA[Reason why you see this message is due to PHP memory leakage. PHP is trying to load a large image or file into memory and is not finding enough space for it to load. If you think, that you will need the necessary feature to upload large files then there are two ways by which [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Reason </strong>why you see this message is due to PHP memory leakage. PHP is trying to load a large image or file into memory and is not finding enough space for it to load.</p>
<p>If you think, that you will need the necessary feature to upload large files then there are two ways by which you can enable this feature.</p>
<p><em>i) Edit the physical file and have the line</em><br />
<strong>ini_set(&#8220;memory_limit&#8221;,&#8221;20M&#8221;);</strong></p>
<p><em>ii) Edit php.ini </em>and add the following line. You need to restart the apache/IIS server once php.ini file is modified.<br />
<strong>memory_limit=32M</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2010/08/php-%e2%80%98fatal-error-allowed-memory-size-of-8388608-bytes-exhausted%e2%80%99.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UTF and Byte Order Mark (BOM)</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/11/utf-and-byte-order-mark-bom.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/11/utf-and-byte-order-mark-bom.html#comments</comments>
		<pubDate>Thu, 12 Nov 2009 01:09:15 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[BOM]]></category>
		<category><![CDATA[Byte Order Mark]]></category>
		<category><![CDATA[multi-lingual website]]></category>
		<category><![CDATA[unicode]]></category>
		<category><![CDATA[Unicode Transformation Format]]></category>
		<category><![CDATA[UTF]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=707</guid>
		<description><![CDATA[UTF abbr. Unicode Transformation Format is a super set of characters that facilitates the display of characters from ALL languages that is currently in use. BOM stands for Byte Order Mark (also known as ZERO WIDTH NON-BREAKING SPACE) appearing at the beginning of a data stream to define the byte order (whether it is little [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UTF</strong> <em>abbr.</em> <strong>Unicode Transformation Format </strong>is a super set of characters that facilitates the display of characters from ALL languages that is currently in use. </p>
<p><strong>BOM </strong>stands for <strong>Byte Order Mark </strong>(also known as <strong>ZERO WIDTH NON-BREAKING SPACE</strong>) appearing at the beginning of a data stream to define the byte order (whether it is <em>little endian </em>or <em>big endian</em>). BOM is to indicate that the file is <strong>Unicode </strong>based.</p>
<p><strong>Possible problem caused by Byte Order Mark</strong><br />
In IE6, it will send the dispaly into quirks mode with its presence before &#8220;&lt;DOCTYPE &#8230;&#8221;</p>
<p><strong>How to check the presence of BOM?</strong><br />
View the source code of the page that does not display correctly in a user agent. Or, open the file in the editor which does not support UTF encoding to see the BOM&#8217;s signature on the files.</p>
<p><em>Suggestion</em><br />
If the user-agent gives problem when you program for multi-lingual websites, check the editor settings to see what format is being used for saving program files. Notepad++ has the option to convert files to UTF and to UTF without BOM. Use the appropriate settings to convert your files.</p>
<p>A character set related tutorial on W3C site can be <a href="http://www.w3.org/International/tutorials/tutorial-char-enc/">found here</a></p>
<p>Byte Order Mark on <a href="http://en.wikipedia.org/wiki/Byte_order_mark">Wiki</a></p>
<p>Article on <a href="http://randomchaos.com/documents/?source=php_and_unicode">PHP and UTF</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/11/utf-and-byte-order-mark-bom.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Parse URL encoded GET data</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/10/php-parse-url-encoded-get-data.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/10/php-parse-url-encoded-get-data.html#comments</comments>
		<pubDate>Thu, 08 Oct 2009 09:45:46 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[parse data]]></category>
		<category><![CDATA[url encode]]></category>
		<category><![CDATA[var_dump]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=689</guid>
		<description><![CDATA[&#60;?php // To build back the URI and to extract the passed parameters, you can use parse_url, parse_string function $extract_string = parse_url($pass_string); echo "&#60;h2&#62;Extracted URI (using parse_url)&#60;/h2&#62;&#60;br /&#62;"; echo "&#60;pre&#62;"; var_dump($extract_string); echo "&#60;/pre&#62;"; // To decode the query string use parse_str function parse_str($extract_string["query"], $extract_query); echo "&#60;h2&#62;Extracted Query String (using parse_str)&#60;/h2&#62;&#60;br /&#62;"; echo "&#60;pre&#62;"; var_dump($extract_query); echo [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: php">
&lt;?php
// To build back the URI and to extract the passed parameters, you can use parse_url, parse_string function
$extract_string = parse_url($pass_string);
echo "&lt;h2&gt;Extracted URI (using parse_url)&lt;/h2&gt;&lt;br /&gt;";
echo "&lt;pre&gt;";
var_dump($extract_string);
echo "&lt;/pre&gt;";

// To decode the query string use parse_str function
parse_str($extract_string["query"], $extract_query);
echo "&lt;h2&gt;Extracted Query String (using parse_str)&lt;/h2&gt;&lt;br /&gt;";
echo "&lt;pre&gt;";
var_dump($extract_query);
echo "&lt;/pre&gt;"; 

?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/10/php-parse-url-encoded-get-data.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: Program to pass data using character encoding (GET Parameter)</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/10/php-program-to-pass-data-using-character-encoding-get-parameter.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/10/php-program-to-pass-data-using-character-encoding-get-parameter.html#comments</comments>
		<pubDate>Tue, 06 Oct 2009 09:39:46 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[character encoding]]></category>
		<category><![CDATA[encode data]]></category>
		<category><![CDATA[get data]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=684</guid>
		<description><![CDATA[PHP program to pass data as GET parameters &#60;?php // PHP 5 how to pass data as a query string /* http_build_query is a function in PHP 5 that enables you to URL encode the query string. You can pass an array or an array of array to this function. The default separator is "&#038;" [...]]]></description>
			<content:encoded><![CDATA[<p><strong>PHP program to pass data as GET parameters</strong></p>
<pre class="brush:php">
&lt;?php
// PHP 5 how to pass data as a query string
/*
http_build_query is a function in PHP 5 that enables you to URL encode the query string. You can pass an array or an array of array to this function. The default separator is "&#038;"
*/

$data = array("first_name" => "Robert",
                "last_name" => "Brown",
                "address" => "123 Adam St., New York"
            );

// URI formatted with character encoding
$pass_string = "http://localhost/demo.php?".http_build_query($data, '');

echo "&lt;h2&gt;Query URI (using http_build_query)&lt;/h2&gt;&lt;br /&gt;";
echo $pass_string;
?&gt;</pre>
<p><strong>Ouput from the above execution:</strong><br />
Query URI (using http_build_query)</p>
<p>http://localhost/demo.php?first_name=Robert&#038;last_name=Brown&#038;address=123+Adam+St.%2C+New+York</p>
]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/10/php-program-to-pass-data-using-character-encoding-get-parameter.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: How to receive the posted XML data?</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/10/php-how-to-receive-the-posted-xml-data.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/10/php-how-to-receive-the-posted-xml-data.html#comments</comments>
		<pubDate>Tue, 06 Oct 2009 03:34:07 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[LINUX]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[XML data]]></category>
		<category><![CDATA[XML posted data]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=682</guid>
		<description><![CDATA[Receive the posted XML data In order to test the posted data, we can create a file creation steps to ensure that we receive the posted data via the $_POST array &#60;?php /* File name: postdata2.php */ $xmlFile = "xmlFile.txt"; $fh = fopen($xmlFile, 'w') or die("Cannot open file"); fwrite($fh, $_POST["xmldata"]); fclose($fh); ?>]]></description>
			<content:encoded><![CDATA[<p><strong>Receive the posted XML data</strong></p>
<p>In order to test the posted data, we can create a file creation steps to ensure that we receive the posted data via the $_POST array</p>
<pre class="brush: php">
&lt;?php
/*
  File name: postdata2.php
*/
    $xmlFile = "xmlFile.txt";
    $fh = fopen($xmlFile, 'w') or die("Cannot open file");
    fwrite($fh, $_POST["xmldata"]);
    fclose($fh);

?>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/10/php-how-to-receive-the-posted-xml-data.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP removing deprecated related errors from display</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/08/php-removing-deprecated-related-errors-from-display.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/08/php-removing-deprecated-related-errors-from-display.html#comments</comments>
		<pubDate>Tue, 01 Sep 2009 01:29:01 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[deprecated error]]></category>
		<category><![CDATA[E_DEPRECATED]]></category>
		<category><![CDATA[nusoap]]></category>
		<category><![CDATA[PHP error]]></category>
		<category><![CDATA[php.ini]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=655</guid>
		<description><![CDATA[To remove deprecated warning message displays when executing PHP programs, open php.ini file and ADD to it error_reporting = E_ALL &#038; ~E_DEPRECATED This is the setting for the production environment where you would not like to display the deprecated function related errors. Sample error message Assigning the return value of new by reference is deprecated [...]]]></description>
			<content:encoded><![CDATA[<p>To remove <em>deprecated </em>warning message displays when executing PHP programs, open <strong>php.ini </strong>file and ADD to it</p>
<p><strong>error_reporting = E_ALL &#038; ~E_DEPRECATED</strong></p>
<p>This is the setting for the production environment where you would not like to display the deprecated function related errors.</p>
<p><em>Sample error message</em><br />
Assigning the return value of new by reference is deprecated in <strong>nusoap.php</strong> on line 7381</p>
]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/08/php-removing-deprecated-related-errors-from-display.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP: Multi-validatable Behavior</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/07/cakephp-multi-validatable-behavior.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/07/cakephp-multi-validatable-behavior.html#comments</comments>
		<pubDate>Tue, 21 Jul 2009 17:40:52 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[cakePHP]]></category>
		<category><![CDATA[cakephp multiple validation]]></category>
		<category><![CDATA[multi-validatable]]></category>
		<category><![CDATA[multivalidatable]]></category>
		<category><![CDATA[multivalidatable behavior]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=512</guid>
		<description><![CDATA[Consider the following scenario where we have a database table:users and that we need carry the validations for the following forms i) Login ii) Change password iii) Add/Edit user records iv) Forgot password You can either write separate controllers and have each controller call a model based on table: users to validate each input field [...]]]></description>
			<content:encoded><![CDATA[<p>Consider the following scenario where we have a database table:users and that we need carry the validations for the following forms<br />
i) Login<br />
ii) Change password<br />
iii) Add/Edit user records<br />
iv) Forgot password </p>
<p>You can either write separate controllers and have each controller call a model based on <em>table: users </em>to validate each input field  or use the same user model to carry out different validations which sounds logical. </p>
<p>It is easy to carry out different validations in a cakephp model by using the <strong>Multi-validatable Behavior</strong> by having different validation sets for different testing conditions.</p>
<p><strong>Key things to note here &#8230;</strong></p>
<p>i) Download the code for <strong>Multivalidatable Behavior</strong> and have it placed under /models/behaviors/ folder</p>
<p>ii) In the model where you want to have multi validation, you need to include multivalidatable behavior like<br />
<strong>var $actsAs = array(&#8220;Multivalidatable&#8221;);</strong></p>
<p>iii) Add validation rulesets array like<br />
var $validationSets = array(&#8216;login&#8217; => array(&#8216;name&#8217;=>array(&#8216;rule&#8217;=>&#8217;alphanumeric&#8217;)),<br />
                                     &#8216;changepassword&#8217; => array(&#8216;password&#8217;=>array(&#8216;rule&#8217;=>&#8217;notEmpty&#8217;))<br />
);</p>
<p>iv) In the controller where you want to apply the validation rule set, you need to add the respective validation like</p>
<p>function login(){<br />
 $this->User->setValidation(&#8216;login&#8217;);<br />
}</p>
<p>function changepassword(){<br />
 $this->User->setValidation(&#8216;changepassword&#8217;);<br />
}</p>
<p>For more info visit <a href="http://bakery.cakephp.org/articles/view/multivalidatablebehavior-using-many-validation-rulesets-per-model" target="_blank">CakePHP Bakery</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/07/cakephp-multi-validatable-behavior.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to turn off register_globals via php.ini?</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/07/how-to-turn-off-register_globals-via-php-ini.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/07/how-to-turn-off-register_globals-via-php-ini.html#comments</comments>
		<pubDate>Thu, 16 Jul 2009 13:54:06 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[PHP security]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[register globals]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=503</guid>
		<description><![CDATA[It is always secured to turn OFF register_globals in PHP applications. Earlier, we have seen how to turn OFF register_globals setting via .htaccess file and in this blog we will use php.ini instead. Using a text editor create a file called php.ini. This will be our first step. Next, we need to add the following [...]]]></description>
			<content:encoded><![CDATA[<p>It is always secured to turn OFF register_globals in PHP applications. Earlier, we have seen how to turn OFF register_globals setting via .htaccess file and in this blog we will use php.ini instead.</p>
<p>Using a text editor create a file called php.ini. This will be our first step.</p>
<p>Next, we need to add the following line of code in php.ini<br />
<strong>register_globals = off</strong></p>
<p>Upload php.ini file to the root folder where your application resides.</p>
]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/07/how-to-turn-off-register_globals-via-php-ini.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Image Upload and Security</title>
		<link>http://kurinchilamp.kurinchilion.com/2009/07/php-image-upload-and-security.html</link>
		<comments>http://kurinchilamp.kurinchilion.com/2009/07/php-image-upload-and-security.html#comments</comments>
		<pubDate>Fri, 10 Jul 2009 01:16:49 +0000</pubDate>
		<dc:creator>kurinchilamp</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tips, Tricks, Guides]]></category>
		<category><![CDATA[file upload]]></category>
		<category><![CDATA[image upload]]></category>
		<category><![CDATA[isuploaded]]></category>
		<category><![CDATA[php user rights]]></category>

		<guid isPermaLink="false">http://kurinchilamp.kurinchilion.com/?p=433</guid>
		<description><![CDATA[List of steps to take care when using PHP to upload images or documents i) use is_uploaded() function to check if the file is uploaded before moving the file from temporary location ii) sanitize the name of the file before moving the file from the temporary location by executing the &#8216;mv&#8217; system command (use escapeshellargs, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>List of steps to take care when using PHP to upload images or documents</strong></p>
<p>i) use is_uploaded() function to check if the file is uploaded before moving the file from temporary location</p>
<p>ii) sanitize the name of the file before moving the file from the temporary location by executing the &#8216;mv&#8217; system command (use escapeshellargs, escapeshellcmd as needed)</p>
<p>iii) chmod the file setting to 644 if needed</p>
<p>iv) the directory from where the file will be moved and the destination directory should be initialized beforehand in order to prevent users from altering the path where the files could be stored</p>
]]></content:encoded>
			<wfw:commentRss>http://kurinchilamp.kurinchilion.com/2009/07/php-image-upload-and-security.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

