<?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>Helmut Granda &#187; PHP</title>
	<atom:link href="http://www.helmutgranda.com/category/programming/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.helmutgranda.com</link>
	<description>learning through interaction</description>
	<lastBuildDate>Wed, 18 Jan 2012 16:08:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>From Kohana to ZendFramework in about 30 minutes</title>
		<link>http://www.helmutgranda.com/2009/12/07/from-kohana-to-zendframework-in-about-30-minutes/</link>
		<comments>http://www.helmutgranda.com/2009/12/07/from-kohana-to-zendframework-in-about-30-minutes/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 05:15:32 +0000</pubDate>
		<dc:creator>Helmut Granda</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[ZendFramework]]></category>
		<category><![CDATA[Kohana]]></category>

		<guid isPermaLink="false">http://www.helmutgranda.com/?p=408</guid>
		<description><![CDATA[I am pleased to say that it took me only about 30 minutes to transfer a basic site writte on Kohana to the ZendFramework, both frameworks make it easy to switch between each other. For one thing you can use the ZendFramework Library in Kohana (although I haven't done it myself people declare is rather [...]]]></description>
			<content:encoded><![CDATA[<p>I am pleased to say that it took me only about 30 minutes to transfer a basic site writte on Kohana to the ZendFramework, both frameworks make it easy to switch between each other. For one thing you can use the ZendFramework Library in Kohana (although I haven't done it myself people declare is rather <a href="http://docs.kohanaphp.com/general/libraries" target="_blank">easy</a>)</p>
<p>The thing I like the most about the ZendFramework is their tool which comes as a part of their library download. I have mainly used the tool to create the <a href="http://framework.zend.com/manual/en/zend.controller.html" target="_blank">controllers</a> and <a href="http://framework.zend.com/manual/en/zend.controller.action.html" target="_blank">actions</a> and so far it has been a time saver and has helped me to see how the framework works in a few keystrokes.</p>
<p>After the first site was a success the next step will be to convert a site with a simple CMS built in Kohana to the ZendFramework, I have to admit that there were two things that held me back for a while into using the ZendFramework.</p>
<h3>Speed</h3>
<p>I read in different blogs how slow ZendFramework was compared to other frameworks such as Kohana, CI, CakePHP and even the new framework called Yii. The graphic below is one of my many findings:</p>
<p><img src="http://www.yiiframework.com/images/performance-20090131.png" /><br />
<i>(Source yiiframework.com)</i></p>
<p>But it is obvious that as the time goes by the framework is getting better and seems like it is getting faster as well.</p>
<h3>Initial setup</h3>
<p>When I tried the framework for the first time was about a year ago or so, it was brand new and people were still getting their heads around it as well as was very limited content in the subject so my first attempt to try it was a failure but months later I come back and wow, what a difference. Not only that but I stayed away from the full package and downloaded the minimal package and started just with the library and it was a breeze.</p>
<p>It is nice to have different packages to choose from and that they get better day by day. So far Zend has made it an easy transition and a nice new PHP development start.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.helmutgranda.com/2009/12/07/from-kohana-to-zendframework-in-about-30-minutes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flash PHP mySQL &#8211; Write to a Database with Flash and PHP</title>
		<link>http://www.helmutgranda.com/2007/08/15/flash-php-mysql-write-to-a-database-with-flash-and-php/</link>
		<comments>http://www.helmutgranda.com/2007/08/15/flash-php-mysql-write-to-a-database-with-flash-and-php/#comments</comments>
		<pubDate>Wed, 15 Aug 2007 17:19:39 +0000</pubDate>
		<dc:creator>Helmut Granda</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.helmutgranda.com/2007/08/15/flash-php-mysql-write-to-a-database-with-flash-and-php/</guid>
		<description><![CDATA[
<object	type="application/x-shockwave-flash"
			data="/labs/swf/phpwritetodb.swf"
			width="450"
			height="150">
	<param name="movie" value="/labs/swf/phpwritetodb.swf" />
</object> I have written a small script that will assist you into using communication between Flash and PHP to write to a mySQL database. The task is simple, verify the contents of the fields in flash and then send the information to PHP who then writes the information into the database. [...]]]></description>
			<content:encoded><![CDATA[
<object	type="application/x-shockwave-flash"
			data="/labs/swf/phpwritetodb.swf"
			width="450"
			height="150">
	<param name="movie" value="/labs/swf/phpwritetodb.swf" />
</object>
<p>I have written a small script that will assist you into using communication between Flash and PHP to write to a mySQL database. The task is simple, verify the contents of the  fields in flash and then send the information to PHP who then writes the information into the database.<span id="more-232"></span></p>
<div class="syntax_hilite"><strong>ActionScript:</strong>
<div id="as-2">
<div>
<ol style="">var submitListener:Object = new Object();<br />
submitListener.click = function(evt:Object) {<br />
&nbsp; &nbsp;try {<br />
&nbsp; &nbsp;&nbsp; &nbsp;checkForm();<br />
&nbsp; &nbsp;}<br />
&nbsp; &nbsp;catch(e) {<br />
&nbsp; &nbsp;&nbsp; &nbsp;result_ta.text = e.toString();<br />
&nbsp; &nbsp;&nbsp; &nbsp;return;<br />
&nbsp; &nbsp;}<br />
&nbsp; &nbsp;var result_lv:LoadVars = new LoadVars();<br />
&nbsp; &nbsp;result_lv.onLoad = function(success:Boolean) {<br />
&nbsp; &nbsp;&nbsp; &nbsp;if (success) {<br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;trace(&quot;THE ERROR = &quot; + result_lv.error);<br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;trace(unescape(result_lv.toString()));<br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;if (result_lv.error != undefined) {<br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;result_ta.text = result_lv.error;<br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}else{<br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;result_ta.text = &quot;Wrote to DB: \n&quot;;<br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;result_ta.text += &quot;First Name = &quot; + result_lv.fname + &quot;\n&quot;;<br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;result_ta.text += &quot;Last Name = &quot; + result_lv.lname + &quot;\n&quot;;<br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;result_ta.text += &quot;Age Name = &quot; + result_lv.age + &quot;\n&quot;;<br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;result_ta.text += &quot;Total Records = &lt;b&gt;&quot; + result_lv.nuRows + &quot;&lt;/b&gt;&quot;;<br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;}<br />
&nbsp; &nbsp; &nbsp; &nbsp;} else {<br />
&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;result_ta.text = &quot;Error connecting to server.&quot;;<br />
&nbsp; &nbsp; &nbsp; &nbsp;}<br />
&nbsp; &nbsp;}<br />
&nbsp; &nbsp;var send_lv:LoadVars = new LoadVars();<br />
&nbsp; &nbsp;send_lv.fname = fn_tfl.text;<br />
&nbsp; &nbsp;send_lv.lname = ln_tfl.text;<br />
&nbsp; &nbsp;send_lv.age = age_tfl.text;<br />
&nbsp; &nbsp;send_lv.sendAndLoad(&quot;path/to/your/php/file.php&quot;, result_lv, &quot;POST&quot;);<br />
};<br />
submit_btn.addEventListener(&quot;click&quot;, submitListener);<br />
function checkForm() {<br />
&nbsp; &nbsp;if (fn_tfl.text == undefined || fn_tfl.text.length &lt; 1) {<br />
&nbsp; &nbsp;&nbsp; &nbsp; throw new Error(&quot;First name is required&quot;);<br />
&nbsp; &nbsp;}<br />
&nbsp; &nbsp;if (ln_tfl.text == undefined || ln_tfl.text.length &lt; 1) {<br />
&nbsp; &nbsp;&nbsp; &nbsp;throw new Error ( &quot;Last name is required&quot;);<br />
&nbsp; &nbsp;}<br />
&nbsp; &nbsp;if (age_tfl.text == undefined || age_tfl.text.length &lt; 1) {<br />
&nbsp; &nbsp;&nbsp; &nbsp;throw new Error ( &quot;Age is required&quot;);<br />
&nbsp; &nbsp;}<br />
}</ol>
</div>
</div>
</div>
<p>This is the script used to create the tables and fields:</p>
<p>
<div class="syntax_hilite"><strong>PHP:</strong>
<div id="php-3">
<div>
<ol style="">CREATE TABLE `users` (&lt;br /&gt;<br />
`id` INT( 6 ) NOT NULL AUTO_INCREMENT PRIMARY KEY ,&lt;br /&gt;<br />
`fname` VARCHAR( 15 ) NOT NULL ,&lt;br /&gt;<br />
`lname` VARCHAR( 15 ) NOT NULL ,&lt;br /&gt;<br />
`age` INT( 3 ) NOT NULL&lt;br /&gt;<br />
) ENGINE = MYISAM ;</ol>
</div>
</div>
</div>
<p>Make sure you check the mySQL version on your server in case you encounter any errors.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.helmutgranda.com/2007/08/15/flash-php-mysql-write-to-a-database-with-flash-and-php/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>The TRUTH about PHP/mySQL security Part II</title>
		<link>http://www.helmutgranda.com/2006/03/02/the-truth-about-phpmysql-security-part-ii/</link>
		<comments>http://www.helmutgranda.com/2006/03/02/the-truth-about-phpmysql-security-part-ii/#comments</comments>
		<pubDate>Thu, 02 Mar 2006 18:05:38 +0000</pubDate>
		<dc:creator>Helmut Granda</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.helmutgranda.com/2006/03/02/the-truth-about-phpmysql-security-part-ii/</guid>
		<description><![CDATA[..continued from The TRUTH about PHP/mySQL security Part I So here we are on "The TRUTH about PHP/mySQL security Part deux", So after reading lots of websites/blogs and reviewing nearly 100 OS PHP/mySQL scripts I have found that everyone has a similar structure Main Page &#124;- imgs &#124;-someimage.jpg &#124;-someimage.jpg &#124;- inc &#124;- dbconnection.php &#124;- extra_file.php [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.helmutgranda.com/2006/02/23/the-truth-about-phpmysql-security-part-i/" target="_self">..continued from The TRUTH about PHP/mySQL security Part I</a></p>
<p>So here we are on "The TRUTH about PHP/mySQL security Part deux", So after reading lots of websites/blogs and reviewing nearly 100 OS PHP/mySQL scripts I have found that everyone has a similar structure</p>
<pre>
Main Page
  |- imgs
     |-someimage.jpg
     |-someimage.jpg
  |- inc
     |- dbconnection.php
     |- extra_file.php
     |- extra_file.php
     |- extra_file.php
</pre>
<p>What we want to look for is the dbconnection.php file. So lets take a look at a simple dbconnection.php file</p>
<div class="syntax_hilite"><strong>PHP:</strong>
<div id="php-6">
<div>
<ol style="">&lt; ?<br />
include &quot;../config.php&quot;;<br />
&nbsp;<br />
function db_connect()<br />
{<br />
&nbsp; &nbsp;$result = @mysql_pconnect($server, $db_user, $db_pass) or die (&quot;Database CONNECT Error (db_fns line 7)&quot;);&nbsp;<br />
&nbsp; &nbsp;if (!$result)<br />
&nbsp; &nbsp; &nbsp; return false;<br />
&nbsp; &nbsp;if (!@mysql_select_db($database))<br />
&nbsp; &nbsp; &nbsp; return false;</p>
<p>&nbsp; &nbsp;return $result;<br />
}</p>
<p>?&gt;
</ol>
</div>
</div>
</div>
<p>But now we see there is an include config.php, lets take a look into that file</p>
<div class="syntax_hilite"><strong>PHP:</strong>
<div id="php-7">
<div>
<ol style="">&lt; ?<br />
$domain&nbsp; &nbsp;&nbsp; &nbsp;= &quot;www.yourdomain.com&quot;; // Your domain name (include www. if used BUT NOT http://)<br />
$server&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;= &quot;localhost&quot;; // Your MySQL server address (usually 'localhost')<br />
$db_user&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &quot;username&quot;; // Your MySQL database username<br />
$db_pass&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &quot;password&quot;; // Your MySQL database password<br />
$database&nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp;= &quot;database&quot;; // Your MySQL database name<br />
$currency&nbsp; &nbsp;= &quot;UK Pounds&quot;; // The currency that your affiliates will be paid in<br />
$emailinfo&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; = &quot;test@email.com&quot;; // Your email address<br />
$yoursitename&nbsp; &nbsp;= &quot;Your Site Name&quot;; // Your sites name<br />
?&gt;
</ol>
</div>
</div>
</div>
<p>Is all this information sensitive? Of course it is! imagine some one getting a hold of your $db_user or $db_pass variable, they could easily create scripts that will log into your DB and either edit the information or destroy it. But I'm not going to go into detail about that, what I am after is to learn how secure it is to leave your php scripts out in the open and from what I have learned so far it is pretty safe do that, but I want to continue to search for what other kind of security is offered by PHP.</p>
<p>...to be continued</p>
]]></content:encoded>
			<wfw:commentRss>http://www.helmutgranda.com/2006/03/02/the-truth-about-phpmysql-security-part-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The TRUTH about PHP/mySQL security Part I</title>
		<link>http://www.helmutgranda.com/2006/02/23/the-truth-about-phpmysql-security-part-i/</link>
		<comments>http://www.helmutgranda.com/2006/02/23/the-truth-about-phpmysql-security-part-i/#comments</comments>
		<pubDate>Thu, 23 Feb 2006 23:06:56 +0000</pubDate>
		<dc:creator>Helmut Granda</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.helmutgranda.com/2006/02/23/the-truth-about-phpmysql-security-part-i/</guid>
		<description><![CDATA[So I finished a small application that I am using only on my computer to avoid any problems on the net in regards to security (name it hackers/crackers/enthusiast/whichever). Since there is no easy way to ask a question like What is the best way to create a secure applicationI decided to send the question out [...]]]></description>
			<content:encoded><![CDATA[<p>So I finished a small application that I am using only on my computer to avoid any problems on the net in regards to security (name it hackers/crackers/enthusiast/whichever).</p>
<p>Since there is no easy way to ask a question like What is the best way to create a secure applicationI decided to send the question out there and ask to what everyone thinks or believes is a secure way to create their applications.</p>
<p>I have been working with PHP/mySQL as user not much as developer for the past years but now trying to learn more about the developer side, I have hit a wall once I have faced Security.</p>
<p>For a while I was certain that putting my sql connection in a PHP file it was ok, this believe was even stronger while using different applications out there that place their connections logarithms inside folders named as simple as connections, and if we want to examine this theory further if you create a Database Connection in Dreamweaver the application itself will create a folder titled Connections and inside that folder it will write the scripts necessary to connect to your DataBase.</p>
<p>With all this in mind I ran into a basic tutorial that highlighted the importance of having your connections secure and one recommendation was to place your connections script (or PHP file) under a password protected directory. This would be an overkill IMHO and not only that but securing a password with another password?</p>
<p><a href="http://www.helmutgranda.com/2006/03/02/the-truth-about-phpmysql-security-part-ii/" target="_self">To Be Continued....</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.helmutgranda.com/2006/02/23/the-truth-about-phpmysql-security-part-i/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fastes way to detect if a radio button has been selected</title>
		<link>http://www.helmutgranda.com/2005/05/17/fastes-way-to-detect-if-a-radio-button-has-been-selected/</link>
		<comments>http://www.helmutgranda.com/2005/05/17/fastes-way-to-detect-if-a-radio-button-has-been-selected/#comments</comments>
		<pubDate>Tue, 17 May 2005 14:38:58 +0000</pubDate>
		<dc:creator>Helmut Granda</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.helmutgranda.com/?p=157</guid>
		<description><![CDATA[There are times when you just need to pull the default value of a radio button selection, rather than creating and array and testing from it. The quick and dirty solution is to place a hidden field right before those items you want to send with default values if nothing is selected. PHP: &#60;input type=&#34;hidden&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>There are times when you just need to pull the default value of a radio button selection, rather than creating and array and testing from it.</p>
<p>The quick and dirty solution is to place a hidden field right before those items you want to send with default values if nothing is selected.</p>
<div class="syntax_hilite"><strong>PHP:</strong>
<div id="php-9">
<div>
<ol style="">&lt;input type=&quot;hidden&quot; name=&quot;NameOfYourRadio&quot; value=&quot;Default Value&quot;/&gt;</ol>
</div>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.helmutgranda.com/2005/05/17/fastes-way-to-detect-if-a-radio-button-has-been-selected/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Test</title>
		<link>http://www.helmutgranda.com/2003/06/06/php-test/</link>
		<comments>http://www.helmutgranda.com/2003/06/06/php-test/#comments</comments>
		<pubDate>Fri, 06 Jun 2003 18:26:57 +0000</pubDate>
		<dc:creator>Helmut Granda</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.helmutgranda.com/?p=71</guid>
		<description><![CDATA[Hi . You are years old.]]></description>
			<content:encoded><![CDATA[<p><code language="PHP3"><br />
Hi <?php echo $_POST["name"]; ?>.<br />
You are <?php echo $_POST["age"]; ?> years old.<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.helmutgranda.com/2003/06/06/php-test/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

