<?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>Camilo Lozano III &#187; PHP</title>
	<atom:link href="http://camilord.kagayan.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://camilord.kagayan.com</link>
	<description>Linux for Servers, Macintosh for Graphics and Windows for Solitair...</description>
	<lastBuildDate>Sat, 24 Jul 2010 13:07:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>[PHP] Shortcuts of If-Else statement</title>
		<link>http://camilord.kagayan.com/2009/04/05/php-shortcuts-of-if-else-statement/</link>
		<comments>http://camilord.kagayan.com/2009/04/05/php-shortcuts-of-if-else-statement/#comments</comments>
		<pubDate>Sun, 05 Apr 2009 08:58:48 +0000</pubDate>
		<dc:creator>Camilo III</dc:creator>
				<category><![CDATA[Info.Tech]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[if-else]]></category>
		<category><![CDATA[shortcut]]></category>

		<guid isPermaLink="false">http://camilord.kagayan.com/?p=165</guid>
		<description><![CDATA[When I learn PHP last September 2005, I was little bit confuse in PHP if-else statement&#8230; especially a statement contains with ? and : but somehow, I got it right. I post this cause somebody ask again what&#8217;s the difference. So told him, its all the same and its just a shortcuts. &#60;?php $authenticated =]]></description>
			<content:encoded><![CDATA[<p>When I learn PHP last September 2005, I was little bit confuse in PHP <span style="color: #0000ff;"><strong>if-else</strong></span> statement&#8230; especially a statement contains with <span style="color: #ff0000;"><strong>?</strong></span> and <span style="color: #ff0000;"><strong>:</strong></span> but somehow, I got it right. I post this cause somebody ask again what&#8217;s the difference. So told him, its all the same and its just a shortcuts.</p>
<p><code><span style="color: #000000;"><span style="color: #0000bb;">&lt;?php</span></span></code></p>
<p><span style="color: #0000ff;">$authenticated</span> <span style="color: #007700;">= </span><span style="color: #0000bb;">true</span><span style="color: #007700;">;</span></p>
<p><span style="color: #ff8000;">// [1] standard if-else statement<br />
</span><span style="color: #007700;">if (</span><span style="color: #0000bb;">$authenticated</span><span style="color: #007700;">)<br />
{<br />
&nbsp; &nbsp; &nbsp;echo </span><span style="color: #dd0000;">&#8216;YES&#8217;</span><span style="color: #007700;">;<br />
}<br />
else<br />
{<br />
</span>&nbsp; &nbsp; &nbsp;<span style="color: #007700;"> echo </span><span style="color: #dd0000;">&#8216;NO&#8217;</span><span style="color: #007700;">;<br />
}</span></p>
<p><span style="color: #ff8000;">// same with [1] <img src='http://camilord.kagayan.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /><br />
</span><span style="color: #007700;">if (</span><span style="color: #0000bb;">$authenticated</span><span style="color: #007700;">) { echo </span><span style="color: #dd0000;">&#8216;YES&#8217;</span><span style="color: #007700;">; } else { echo </span><span style="color: #dd0000;">&#8216;NO&#8217;</span><span style="color: #007700;">; }</span></p>
<p><span style="color: #ff8000;">// [2] lil bit shortcut<br />
</span><span style="color: #007700;">if (</span><span style="color: #0000bb;">$authenticated</span><span style="color: #007700;">)<br />
</span>&nbsp; &nbsp; &nbsp;<span style="color: #007700;"> echo </span><span style="color: #dd0000;">&#8216;YES&#8217;</span><span style="color: #007700;">;<br />
else<br />
</span>&nbsp; &nbsp; &nbsp;<span style="color: #007700;"> echo </span><span style="color: #dd0000;">&#8216;NO&#8217;</span><span style="color: #007700;">;</span></p>
<p><span style="color: #ff8000;">// [3] the shortcut<br />
</span><span style="color: #007700;">echo </span><span style="color: #0000bb;">$result </span><span style="color: #007700;">= (</span><span style="color: #0000bb;">$authenticated</span><span style="color: #007700;">) ? </span><span style="color: #dd0000;">&#8216;YES&#8217; </span><span style="color: #007700;">: </span><span style="color: #dd0000;">&#8216;NO&#8217;</span><span style="color: #007700;">;</span></p>
<p><span style="color: #0000bb;">?&gt;</span></p>
<p>Or let me say its an evolution of if-else statement&#8230; Hahaha.. or maybe the laziness of the programmer. <img src='http://camilord.kagayan.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  So got it? hehehehe..</p>
]]></content:encoded>
			<wfw:commentRss>http://camilord.kagayan.com/2009/04/05/php-shortcuts-of-if-else-statement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[PHP] How to upload a file</title>
		<link>http://camilord.kagayan.com/2009/04/02/php-how-to-upload-a-file/</link>
		<comments>http://camilord.kagayan.com/2009/04/02/php-how-to-upload-a-file/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 08:48:37 +0000</pubDate>
		<dc:creator>Camilo III</dc:creator>
				<category><![CDATA[Info.Tech]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[how to upload]]></category>
		<category><![CDATA[preview uploaded files]]></category>
		<category><![CDATA[sample script]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://camilord.kagayan.com/?p=139</guid>
		<description><![CDATA[I would like to share this script to all since most of my friends ask how to create an upload script using PHP. Download the PHP script at; Main Download: Mirror 1: simple_upload.zip Upload File Demo: http://www.cable21.net/camilord/simple_upload/index.html Modification according to your preferred setup Its default upload directory is uploads/ and to change this, just change]]></description>
			<content:encoded><![CDATA[<p>I would like to share this script to all since most of my friends ask how to create an upload script using PHP.</p>
<p>Download the PHP script at;</p>
<ol>
<li>Main Download: <a class="downloadlink" href="http://camilord.kagayan.com/download/simple_upload.zip" title="Versionv0.0.2 downloaded 6 times" >Simple Upload Demo (6)</a><br />
<a title="Download" href="http://www.cable21.net/camilord/simple_upload/simple_upload.zip" target="_blank"></a></li>
<li>Mirror 1: <a title="Download" href="http://www.cable21.net/camilord/simple_upload/simple_upload.zip" target="_blank">simple_upload.zip</a></li>
</ol>
<p>Upload File Demo: <a title="Upload Demo" href="http://www.cable21.net/camilord/simple_upload/index.html" target="_blank">http://www.cable21.net/camilord/simple_upload/index.html</a></p>
<p><strong>Modification according to your preferred setup</strong></p>
<p>Its default upload directory is <em>uploads/</em> and to change this, just change the line 19;</p>
<p><span style="color: #008000;">// set upload destination</span><br />
<span style="color: #ff6600;">$uploaddir</span> = <span style="color: #993300;">&#8220;uploads/&#8221;</span>;</p>
<p>In the script, it is capable to validate allowed file types. As default, images files are only allowed to be uploaded. To change this, just edit the <em>upload.php </em>at line 37.</p>
<p><span style="color: #008000;">// allowed file types</span><br />
<span style="color: #ff6600;">$validMIME</span> = <span style="color: #3366ff;">array</span>(<span style="color: #993300;">&#8216;jpg&#8217;</span>,<span style="color: #993300;">&#8216;jpeg&#8217;</span>,<span style="color: #993300;">&#8216;bmp&#8217;</span>,<span style="color: #993300;">&#8216;png&#8217;</span>,<span style="color: #993300;">&#8216;gif&#8217;</span>);</p>
<p>Just add any file extension you want to allow&#8230; Sample;</p>
<p><span style="color: #008000;">// allowed file types</span><br />
<span style="color: #ff6600;">$validMIME</span> = <span style="color: #3366ff;">array</span>(<span style="color: #993300;">&#8216;jpg&#8217;</span>,<span style="color: #993300;">&#8216;jpeg&#8217;</span>,<span style="color: #993300;">&#8216;bmp&#8217;</span>,<span style="color: #993300;">&#8216;png&#8217;</span>,<span style="color: #993300;">&#8216;gif&#8217;</span>,<span style="color: #ff0000;">&#8216;doc&#8217;</span>,<span style="color: #ff0000;">&#8216;zip&#8217;</span>,<span style="color: #ff0000;">&#8216;pdf&#8217;</span>);</p>
<p>So I just allowed Document, Zip and PDF files&#8230;</p>
<p>That&#8217;s all.. I think everything is understandable.. hehehe.. Please read also the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://camilord.kagayan.com/2009/04/02/php-how-to-upload-a-file/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Fatal error:  Allowed memory size of 8388608 bytes exhausted (tried to allocate 4800 bytes)</title>
		<link>http://camilord.kagayan.com/2009/02/09/php-fatal-error-allowed-memory-size-of-8388608-bytes-exhausted-tried-to-allocate-4800-bytes/</link>
		<comments>http://camilord.kagayan.com/2009/02/09/php-fatal-error-allowed-memory-size-of-8388608-bytes-exhausted-tried-to-allocate-4800-bytes/#comments</comments>
		<pubDate>Mon, 09 Feb 2009 15:20:53 +0000</pubDate>
		<dc:creator>Camilo III</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Info.Tech]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[8MB]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[ini_set()]]></category>
		<category><![CDATA[limit]]></category>
		<category><![CDATA[memory]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[php.ini]]></category>
		<category><![CDATA[resource]]></category>

		<guid isPermaLink="false">http://camilord.kagayan.com/?p=106</guid>
		<description><![CDATA[When I first encountered this error, I thought something wrong with my apache-php integration. Thank God it&#8217;s not the one I thought. This PHP Fatal error message will be encountered if your PHP script memory requirements exceed the default 8MB limit. Somehow, you can overcome this by doing two methods. 1. Set Resource Limits in]]></description>
			<content:encoded><![CDATA[<p>When I first encountered this error, I thought something wrong with my apache-php integration. Thank God it&#8217;s not the one I thought.</p>
<p>This PHP Fatal error message will be encountered if your PHP script memory requirements exceed the default 8MB limit. Somehow, you can overcome this by doing two methods.</p>
<p>1. Set Resource Limits in <code>/etc/php.ini</code></p>
<p><code>;;;;;;;;;;;;;;;;;;;<br />
; Resource Limits ;<br />
;;;;;;;;;;;;;;;;;;;</code></p>
<p><code>max_execution_time = 45     ; Maximum execution time of each script<br />
max_input_time = 60     ; Maximum amount may spend parsing request data<br />
memory_limit = <span style="color: #ff0000;"><strong>12M</strong></span> ; Maximum amount of memory a script may consume (8MB)</code></p>
<p>2. Initiate a function to set the Resources Limit</p>
<p><code>ini_set("memory_limit","12M");</code></p>
<p>Why so serious?!? that&#8217;s it&#8230; your done! <img src='http://camilord.kagayan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://camilord.kagayan.com/2009/02/09/php-fatal-error-allowed-memory-size-of-8388608-bytes-exhausted-tried-to-allocate-4800-bytes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
