<?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>PapaFace.com &#187; Coding</title>
	<atom:link href="http://www.papaface.com/blog/category/coding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.papaface.com/blog</link>
	<description>Interesting stuff guaranteed!</description>
	<lastBuildDate>Sat, 21 Aug 2010 18:19:51 +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>Simple PHP Page Protector</title>
		<link>http://www.papaface.com/blog/2010/03/07/simple-php-page-protector/</link>
		<comments>http://www.papaface.com/blog/2010/03/07/simple-php-page-protector/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 22:34:29 +0000</pubDate>
		<dc:creator>papa_face</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[protection]]></category>
		<category><![CDATA[simple]]></category>

		<guid isPermaLink="false">http://www.papaface.com/blog/?p=156</guid>
		<description><![CDATA[A couple of years ago I posted a way to protect a PHP page from access on the internet in an easy way. I've spent around 15 minutes producing what I feel is a better version of the same script at the original post. In order for it to work, you'll need a MD5 string, [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of years ago I posted a way to protect a PHP page from access on the internet in an easy way.<br />
I've spent around 15 minutes producing what I feel is a better version of the same script at <a href="http://www.papaface.com/blog/2007/11/30/protect-a-php-page-the-easy-way/">the original post</a>.<br />
In order for it to work, you'll need a MD5 string, which you can get using the below box, just enter you password and then replace 6121904d3138741fb744fba85c276606 in the code, its quite self-explanatory.<br />
<iframe src="/coding/pageprotector/iframe.php" width="420" height="75"></iframe></p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?php</span><br />
<a href="http://www.php.net/session_start"><span class="kw3">session_start</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
<span class="re0">$_userpassword</span> = <span class="st0">&quot;6121904d3138741fb744fba85c276606&quot;</span>;<br />
<span class="re0">$_username</span> = <span class="st0">&quot;pass&quot;</span>;<br />
<span class="coMULTI">/*DO NOT EDIT*/</span><br />
<span class="kw1">if</span>&nbsp; &nbsp; &nbsp; <span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">'pageprotector'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span>&nbsp; &nbsp; &nbsp; <span class="br0">&#40;</span><a href="http://www.php.net/md5"><span class="kw3">md5</span></a><span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">'pageprotectorpass'</span><span class="br0">&#93;</span><span class="br0">&#41;</span> == <span class="re0">$_userpassword</span> &amp;&amp; <span class="re0">$_POST</span><span class="br0">&#91;</span><span class="st0">'pageprotectoruser'</span><span class="br0">&#93;</span> == <span class="re0">$_username</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$_SESSION</span><span class="br0">&#91;</span><span class="st0">'bG9nZ2VkaW4p='</span><span class="br0">&#93;</span>=<span class="re0">$_userpassword</span>; <span class="re0">$_SESSION</span><span class="br0">&#91;</span><span class="st0">'bG9nZ2VkaW4u='</span><span class="br0">&#93;</span>=<span class="re0">$_username</span>; <a href="http://www.php.net/header"><span class="kw3">header</span></a><span class="br0">&#40;</span><span class="st0">'Location:'</span>.<span class="re0">$_SERVER</span><span class="br0">&#91;</span><span class="st0">'PHP_SELF'</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/header"><span class="kw3">header</span></a><span class="br0">&#40;</span><span class="st0">'Location:'</span>.<span class="re0">$_SERVER</span><span class="br0">&#91;</span><span class="st0">'PHP_SELF'</span><span class="br0">&#93;</span>.<span class="st0">'?wrongpass=1'</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="kw1">if</span>&nbsp; &nbsp; &nbsp; <span class="br0">&#40;</span><span class="re0">$_GET</span><span class="br0">&#91;</span><span class="st0">'pageprotectlogout'</span><span class="br0">&#93;</span> == <span class="st0">&quot;1&quot;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/unset"><span class="kw3">unset</span></a><span class="br0">&#40;</span><span class="re0">$_SESSION</span><span class="br0">&#91;</span><span class="st0">'bG9nZ2VkaW4p='</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;unset<span class="br0">&#40;</span><span class="re0">$_SESSION</span><span class="br0">&#91;</span><span class="st0">'bG9nZ2VkaW4u='</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;header<span class="br0">&#40;</span><span class="st0">'Location:'</span>.<span class="re0">$_SERVER</span><span class="br0">&#91;</span><span class="st0">'PHP_SELF'</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="kw1">if</span>&nbsp; &nbsp; &nbsp; <span class="br0">&#40;</span><span class="re0">$_SESSION</span><span class="br0">&#91;</span><span class="st0">'bG9nZ2VkaW4p='</span><span class="br0">&#93;</span> != <span class="re0">$_userpassword</span> &amp;&amp; <span class="re0">$_SESSION</span><span class="br0">&#91;</span><span class="st0">'bG9nZ2VkaW4u='</span><span class="br0">&#93;</span> != <span class="re0">$_username</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span>&nbsp; &nbsp; &nbsp; <span class="br0">&#40;</span><span class="re0">$_GET</span><span class="br0">&#91;</span><span class="st0">'wrongpass'</span><span class="br0">&#93;</span> == <span class="st0">&quot;1&quot;</span><span class="br0">&#41;</span> <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;Wrong password&quot;</span>;?&gt;<br />
&lt;form action=<span class="st0">&quot;&lt;?php echo $_SERVER['PHP_SELF']; ?&gt;&quot;</span> method=<span class="st0">&quot;post&quot;</span>&gt;<br />
Username: &lt;input name=<span class="st0">&quot;pageprotectoruser&quot;</span> type=<span class="st0">&quot;text&quot;</span> /&gt; Password: &lt;input name=<span class="st0">&quot;pageprotectorpass&quot;</span> type=<span class="st0">&quot;text&quot;</span> /&gt;&lt;input name=<span class="st0">&quot;pageprotector&quot;</span> type=<span class="st0">&quot;submit&quot;</span> value=<span class="st0">&quot;Login&quot;</span>&gt;<br />
&lt;/form&gt;&lt;?php<br />
&nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/exit"><span class="kw3">exit</span></a>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="coMULTI">/*DO NOT EDIT ABOVE*/</span><br />
<span class="kw2">?&gt;</span><br />
&nbsp;</div>
<p><span class="slashdigglicious"><br />
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2010%2F03%2F07%2Fsimple-php-page-protector%2F&amp;title=Simple+PHP+Page+Protector" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a><br />
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2010%2F03%2F07%2Fsimple-php-page-protector%2F&amp;title=Simple+PHP+Page+Protector" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a><br />
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2010%2F03%2F07%2Fsimple-php-page-protector%2F&amp;title=Simple+PHP+Page+Protector" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a><br />
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2010%2F03%2F07%2Fsimple-php-page-protector%2F&amp;title=Simple+PHP+Page+Protector" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2010%2F03%2F07%2Fsimple-php-page-protector%2F&amp;title=Simple+PHP+Page+Protector', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a><br />
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2010%2F03%2F07%2Fsimple-php-page-protector%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a><br />
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2010%2F03%2F07%2Fsimple-php-page-protector%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a><br />
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2010%2F03%2F07%2Fsimple-php-page-protector%2F&amp;title=Simple+PHP+Page+Protector" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a><br />
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2010%2F03%2F07%2Fsimple-php-page-protector%2F&amp;title=Simple+PHP+Page+Protector" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.papaface.com/blog/2010/03/07/simple-php-page-protector/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Copy to clipboard using javascript</title>
		<link>http://www.papaface.com/blog/2009/01/08/copy-to-clipboard-using-javascript/</link>
		<comments>http://www.papaface.com/blog/2009/01/08/copy-to-clipboard-using-javascript/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 13:27:10 +0000</pubDate>
		<dc:creator>neological</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[learn]]></category>
		<category><![CDATA[paste]]></category>
		<category><![CDATA[shortcut]]></category>

		<guid isPermaLink="false">http://www.papaface.com/blog/?p=102</guid>
		<description><![CDATA[In a current project i am working on, I need to be able to copy some posted content to my clipboard. Well I looked for a solution so I thought I&#8217;d show you&#8230;. &#60;span style=&#34;#800000;&#34;&#62;&#60;span id=&#34;texttobecopied&#34; &#160;STYLE=&#34;height:150;width:162;background-color:pink&#34;&#62; This text will be copied onto the clipboard when you click the button below. Try it! &#60;/SPAN&#62; &#60;/span&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>In a  current project i am working on, I need to be able to copy some posted content to my clipboard. Well I looked for a solution so I thought I&#8217;d show you&#8230;.</p>
<div class="dean_ch" style="white-space: wrap;">
&lt;span style=<span class="st0">&quot;#800000;&quot;</span>&gt;&lt;span id=<span class="st0">&quot;texttobecopied&quot;</span> &nbsp;STYLE=<span class="st0">&quot;height:150;width:162;background-color:pink&quot;</span>&gt;<br />
This text will be copied onto the clipboard when you click the button below. Try it!<br />
&lt;/SPAN&gt; &lt;/span&gt;</div>
<div class="dean_ch" style="white-space: wrap;">&lt;span style=<span class="st0">&quot;#800000;&quot;</span>&gt;&lt;TEXTAREA ID=<span class="st0">&quot;holdtext&quot;</span> STYLE=<span class="st0">&quot;display:none;&quot;</span>&gt;<br />
&lt;/TEXTAREA&gt;<br />
&lt;BUTTON onClick=<span class="st0">&quot;ClipBoard();&quot;</span>&gt;Copy to Clipboard&lt;/BUTTON&gt;&lt;/span&gt;</div>
<p>We have a button here and a span that contains text that will be copied. The button is calling &#8220;ClipBoard();&#8221; . This is a function that we have written in javascript. It is below&#8230;</p>
<div class="dean_ch" style="white-space: wrap;">
&lt;code&gt;&lt;SCRIPT LANGUAGE=<span class="st0">&quot;JavaScript&quot;</span>&gt;&lt;/code&gt;</p>
<p><span class="kw2">function</span> ClipBoard<span class="br0">&#40;</span><span class="br0">&#41;</span><br />
<span class="br0">&#123;</span><br />
holdtext.innerText = texttobecopied.innerText;<br />
Copied = holdtext.createTextRange<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
Copied.execCommand<span class="br0">&#40;</span><span class="st0">&quot;Copy&quot;</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span></p>
<p><span class="kw2">&lt;/SCRIPT&gt;</span></div>
<p><span style="#800000;">This script reads the inner text of the span, we defined the span on the first line of the function&#8230;</span></p>
<div class="dean_ch" style="white-space: wrap;">&lt;span style=<span class="st0">&quot;#800000;&quot;</span>&gt; holdtext.innerText = texttobecopied.innerText;&lt;/span&gt;</div>
<p><span style="#800000;">and then holds it in the computers memory. You can assign when clicking an image to copy text or other data by just adding</span></p>
<div class="dean_ch" style="white-space: wrap;">&lt;span style=<span class="st0">&quot;#800000;&quot;</span>&gt;onclick=<span class="st0">&quot;ClipBoard();&quot;</span>&lt;/span&gt;</div>
<p><span style="#800000;">To any Link,Image, script ect&#8230;<br />
</span><br />
<span class="slashdigglicious"><br />
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2009%2F01%2F08%2Fcopy-to-clipboard-using-javascript%2F&amp;title=Copy+to+clipboard+using+javascript" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a><br />
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2009%2F01%2F08%2Fcopy-to-clipboard-using-javascript%2F&amp;title=Copy+to+clipboard+using+javascript" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a><br />
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2009%2F01%2F08%2Fcopy-to-clipboard-using-javascript%2F&amp;title=Copy+to+clipboard+using+javascript" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a><br />
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2009%2F01%2F08%2Fcopy-to-clipboard-using-javascript%2F&amp;title=Copy+to+clipboard+using+javascript" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2009%2F01%2F08%2Fcopy-to-clipboard-using-javascript%2F&amp;title=Copy+to+clipboard+using+javascript', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a><br />
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2009%2F01%2F08%2Fcopy-to-clipboard-using-javascript%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a><br />
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2009%2F01%2F08%2Fcopy-to-clipboard-using-javascript%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a><br />
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2009%2F01%2F08%2Fcopy-to-clipboard-using-javascript%2F&amp;title=Copy+to+clipboard+using+javascript" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a><br />
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2009%2F01%2F08%2Fcopy-to-clipboard-using-javascript%2F&amp;title=Copy+to+clipboard+using+javascript" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.papaface.com/blog/2009/01/08/copy-to-clipboard-using-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Try and Catch (&#8230;me if you can)</title>
		<link>http://www.papaface.com/blog/2008/10/13/try-and-catch-me-if-you-can/</link>
		<comments>http://www.papaface.com/blog/2008/10/13/try-and-catch-me-if-you-can/#comments</comments>
		<pubDate>Mon, 13 Oct 2008 01:06:15 +0000</pubDate>
		<dc:creator>Mike2K</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.papaface.com/blog/?p=70</guid>
		<description><![CDATA[PHP is a great language for creating dynamic websites and has a lot of functions to do just about everything on the server side. Only, with all those functions you need a good error handler. The other languages like perl, c, c# etc. have a try and catch function. As of version 5, this function [...]]]></description>
			<content:encoded><![CDATA[<p>PHP is a great language for creating dynamic websites and has a lot of functions to do just about everything on the server side.</p>
<p>Only, with all those functions you need a good error handler. The other languages like perl, c, c# etc. have a try and catch function. As of version 5, this function is also available in PHP. In this post I will try to explain to usage and benefits of try and catch. Ready ?</p>
<p><strong>Example:</strong><br />
Let's say you have a website with some blog posts. Visitors can view the latest post by going to www.example.com/?posts<br />
You also create a page to let visitors read a single post. They'll go to: www.example.com/?posts&amp;item=1<br />
This will tell your script that it needs to get item #1 from the database and display it. Now, as we all know, visitors will try all sorts of things, for example: www.example.com/?posts&amp;item=blablabla. This well tell your script that it should fetch item #blablabla from the database which, ofcourse, does not exist and you get a pretty MySQL error.</p>
<p><strong>Try and Catch</strong><br />
Try and catch works by 'throwing errors'. The script executes a try block and if an error is thrown, the try block will end and the catch function will be executed.</p>
<div class="dean_ch" style="white-space: wrap;">
try <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$_GET</span><span class="br0">&#91;</span><span class="st0">'item'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$postId</span> = <a href="http://www.php.net/mysql_real_escape_string"><span class="kw3">mysql_real_escape_string</span></a><span class="br0">&#40;</span><span class="re0">$_GET</span><span class="br0">&#91;</span><span class="st0">'item'</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">$qryPost</span> = <span class="st0">&quot;SELECT * FROM posts WHERE id = $postId&quot;</span>;</p>
<p>&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>!<span class="re0">$rsltPost</span> = <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="re0">$qryPost</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Throw <span class="kw2">new</span> Exception<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="kw1">if</span> <span class="br0">&#40;</span>!<a href="http://www.php.net/mysql_num_rows"><span class="kw3">mysql_num_rows</span></a><span class="br0">&#40;</span><span class="re0">$rsltPost</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Throw <span class="kw2">new</span> Exception<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; <span class="re0">$arrPost</span> = <a href="http://www.php.net/mysql_fetch_array"><span class="kw3">mysql_fetch_array</span></a><span class="br0">&#40;</span><span class="re0">$rsltPost</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="re0">$arrPost</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span><br />
<span class="br0">&#125;</span><br />
catch <span class="br0">&#40;</span>Exception <span class="re0">$e</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;There is no such post!&quot;</span>;<br />
<span class="br0">&#125;</span></div>
<p><strong>Try<br />
</strong>For starters, all the code that we want to error check, needs to be in the try statement. So we start with:</p>
<div class="dean_ch" style="white-space: wrap;">try <span class="br0">&#123;</span></div>
<p>Next is the code to check whether the URL contains the item variable and if it does, execute the code to display that item. Ofcourse we sanitize the variable before sending it to the database.</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/isset"><span class="kw3">isset</span></a><span class="br0">&#40;</span><span class="re0">$_GET</span><span class="br0">&#91;</span><span class="st0">'item'</span><span class="br0">&#93;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <span class="re0">$postId</span> = <a href="http://www.php.net/mysql_real_escape_string"><span class="kw3">mysql_real_escape_string</span></a><span class="br0">&#40;</span><span class="re0">$_GET</span><span class="br0">&#91;</span><span class="st0">'item'</span><span class="br0">&#93;</span><span class="br0">&#41;</span>;</div>
<p><strong>Query</strong><br />
Normally I write my queries like this:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re0">$qryPost</span> = <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a> <span class="br0">&#40;</span><span class="st0">&quot;SELECT * FROM Posts WHERE id = $postId&quot;</span><span class="br0">&#41;</span> or <a href="http://www.php.net/die"><span class="kw3">die</span></a> <span class="br0">&#40;</span><a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
<p>That works fine for most queries. The downside is that when an error occurs, the script dies and displays an error message which could reveal some of your MySQL configuration to the visitor!<br />
We are going to write our query like this:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re0">$qryPost</span> = <span class="st0">&quot;SELECT * FROM posts WHERE id = $postId&quot;</span>;</div>
<p>Next we're going to evaluate the query and check if it runs without an error:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw1">if</span> <span class="br0">&#40;</span>!<span class="re0">$rsltPost</span> = <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="re0">$qryPost</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Throw <span class="kw2">new</span> Exception<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; <span class="br0">&#125;</span></div>
<p>As you see, if the query fails, an error is thrown. this will stop the rest of the <strong>try</strong> statement from executing and go to the catch statement. The same goes for the second if statement. Only this time it checks if the query returns a row.</p>
<p><strong>Catch</strong><br />
The catch statement is executed when an error is thrown.</p>
<div class="dean_ch" style="white-space: wrap;">catch <span class="br0">&#40;</span>Exception <span class="re0">$e</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;There is no such post!&quot;</span>;<br />
<span class="br0">&#125;</span></div>
<p>Will only echo "There is no such post!" and the rest of your script/site will continue to function.<br />
The try statement also has some debugging features. You can, for example, get the script line on which the error is thrown, or the exact error message.</p>
<p>This is just a basic example of how to use try and catch. You can read more in the <a href="http://www.php.net/try">php manual</a><br />
<span class="slashdigglicious"><br />
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F10%2F13%2Ftry-and-catch-me-if-you-can%2F&amp;title=Try+and+Catch+%28%26%238230%3Bme+if+you+can%29" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a><br />
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F10%2F13%2Ftry-and-catch-me-if-you-can%2F&amp;title=Try+and+Catch+%28%26%238230%3Bme+if+you+can%29" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a><br />
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F10%2F13%2Ftry-and-catch-me-if-you-can%2F&amp;title=Try+and+Catch+%28%26%238230%3Bme+if+you+can%29" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a><br />
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F10%2F13%2Ftry-and-catch-me-if-you-can%2F&amp;title=Try+and+Catch+%28%26%238230%3Bme+if+you+can%29" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F10%2F13%2Ftry-and-catch-me-if-you-can%2F&amp;title=Try+and+Catch+%28%26%238230%3Bme+if+you+can%29', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a><br />
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F10%2F13%2Ftry-and-catch-me-if-you-can%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a><br />
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F10%2F13%2Ftry-and-catch-me-if-you-can%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a><br />
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F10%2F13%2Ftry-and-catch-me-if-you-can%2F&amp;title=Try+and+Catch+%28%26%238230%3Bme+if+you+can%29" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a><br />
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F10%2F13%2Ftry-and-catch-me-if-you-can%2F&amp;title=Try+and+Catch+%28%26%238230%3Bme+if+you+can%29" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.papaface.com/blog/2008/10/13/try-and-catch-me-if-you-can/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Youtube Without The Video</title>
		<link>http://www.papaface.com/blog/2008/03/23/youtube-without-the-video/</link>
		<comments>http://www.papaface.com/blog/2008/03/23/youtube-without-the-video/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 19:52:52 +0000</pubDate>
		<dc:creator>papa_face</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[controls]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[no video]]></category>
		<category><![CDATA[play]]></category>
		<category><![CDATA[stop]]></category>
		<category><![CDATA[trick]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://www.papaface.com/blog/2008/03/23/youtube-without-the-video/</guid>
		<description><![CDATA[Hello there, It has been a while since I posted something new on my blog, I&#8217;ve just been to busy lately. Today I am going to show you how to put a Youtube video on your website but in a way that only allows you to hear the video rather than being able to see [...]]]></description>
			<content:encoded><![CDATA[<p>Hello there,<br />
It has been a while since I posted something new on my blog, I&#8217;ve just been to busy lately.</p>
<p>Today I am going to show you how to put a Youtube video on your website but in a way that only allows you to hear the video rather than being able to see it as well.</p>
<p><strong>Why would I want to do that?</strong><br />
I hear you say. Well sometimes you might want to put music on a page. Youtube is an ideal place to get music from.<br />
Of course you can simply put the video in the page as you would normally do, but that big intrusive box can be annoying at times, especially on myspace etc.</p>
<p>Although this may not be much use to you, it is a nice trick to know <img src='http://www.papaface.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>You can use this <a target="_blank" href="http://papaface.com/blog/resources/YoutubeWithoutVideo/">tool</a> to produce the code needed!</p>
<p>The tool allows you to put in Play and Stop controls, but they only work for Firefox.</p>
<p>Feel free to show me a better way to do this if there is one <img src='http://www.papaface.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<span class="slashdigglicious"><br />
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F03%2F23%2Fyoutube-without-the-video%2F&amp;title=Youtube+Without+The+Video" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a><br />
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F03%2F23%2Fyoutube-without-the-video%2F&amp;title=Youtube+Without+The+Video" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a><br />
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F03%2F23%2Fyoutube-without-the-video%2F&amp;title=Youtube+Without+The+Video" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a><br />
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F03%2F23%2Fyoutube-without-the-video%2F&amp;title=Youtube+Without+The+Video" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F03%2F23%2Fyoutube-without-the-video%2F&amp;title=Youtube+Without+The+Video', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a><br />
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F03%2F23%2Fyoutube-without-the-video%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a><br />
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F03%2F23%2Fyoutube-without-the-video%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a><br />
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F03%2F23%2Fyoutube-without-the-video%2F&amp;title=Youtube+Without+The+Video" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a><br />
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F03%2F23%2Fyoutube-without-the-video%2F&amp;title=Youtube+Without+The+Video" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.papaface.com/blog/2008/03/23/youtube-without-the-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL &#8211; Connecting, Selecting&#8230;. and more.</title>
		<link>http://www.papaface.com/blog/2008/01/15/mysql-connecting-selecting-and-more/</link>
		<comments>http://www.papaface.com/blog/2008/01/15/mysql-connecting-selecting-and-more/#comments</comments>
		<pubDate>Tue, 15 Jan 2008 18:26:28 +0000</pubDate>
		<dc:creator>papa_face</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.papaface.com/blog/2008/01/15/mysql-connecting-selecting-and-more/</guid>
		<description><![CDATA[Today I am going to show you various things that you can do with MySQL using PHP. I am going to assume you have fairly good knowledge of PHP while following these instructions. Connecting to MySQL Connecting to MySQL is extremely simple. I am going to presume you know your MySQL credentials, if you don't [...]]]></description>
			<content:encoded><![CDATA[<p>Today I am going to show you various things that you can do with MySQL using PHP.<br />
I am going to assume you have fairly good knowledge of PHP while following these instructions.</p>
<p><strong>Connecting to MySQL</strong></p>
<p>Connecting to MySQL is extremely simple. I am going to presume you know your MySQL credentials, if you don't know them, find them out <img src='http://www.papaface.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  .</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="re0">$databasehost</span> = <span class="st0">&quot;localhost&quot;</span>; <span class="co1">//put your MySQL host into this variable. It is usually localhost</span><br />
<span class="re0">$databaseusername</span> = <span class="st0">&quot;root&quot;</span>; <span class="co1">//put your MySQL username into this variable.</span><br />
<span class="re0">$databasepassword</span> = <span class="st0">&quot;somethingreallydifficulttoguess&quot;</span>; <span class="co1">//put your MySQL password into this variable.</span><br />
<span class="co1">// I have used long variable names because the likelihood of them being overwritten is unlikely.</span><br />
<span class="re0">$conn</span> = <a href="http://www.php.net/mysql_connect"><span class="kw3">mysql_connect</span></a><span class="br0">&#40;</span><span class="re0">$databasehost</span>,<span class="re0">$databaseusername</span>,<span class="re0">$databasepassword</span><span class="br0">&#41;</span> or <a href="http://www.php.net/die"><span class="kw3">die</span></a> <span class="br0">&#40;</span><a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp;</div>
<p>And thats it. In the event that your credentials are incorrect and error will be produced.</p>
<p><strong>Creating a MySQL database using PHP</strong></p>
<p>Creating a database in PHP is extremely simple.</p>
<div class="dean_ch" style="white-space: wrap;">
<a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="st0">&quot;CREATE DATABASE `database_name`&quot;</span>,<span class="re0">$conn</span><span class="br0">&#41;</span> or <a href="http://www.php.net/die"><span class="kw3">die</span></a> <span class="br0">&#40;</span><a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
<span class="co1">//this will create a database called &quot;database_name&quot; and use the connection we established earlier to create that database.</span><br />
&nbsp;</div>
<p><strong>Selecting the MySQL database</strong></p>
<p>Selecting the MySQL database is even simpler. Once you know your database name you can use this code to select the database:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="re0">$databasename</span> = <span class="st0">&quot;database_name&quot;</span>; <span class="co1">// the name of the database you want to select.</span><br />
<a href="http://www.php.net/mysql_select_db"><span class="kw3">mysql_select_db</span></a><span class="br0">&#40;</span><span class="re0">$databasename</span>,<span class="re0">$conn</span><span class="br0">&#41;</span> or <a href="http://www.php.net/die"><span class="kw3">die</span></a> <span class="br0">&#40;</span><a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
<span class="co1">//the database you created earlier is now selected. If you already have a database created, you do not need to run the CREATE DATABASE code obviously.</span><br />
&nbsp;</div>
<p><strong>Creating a MySQL table within a database</strong></p>
<p>Things start to get a bit more complicated when it comes to creating tables. You may want to look at the MySQL website to get some more information on how to create tables using SQL.</p>
<p>Here is how we would create a table called "new_table" in the database.</p>
<div class="dean_ch" style="white-space: wrap;">
<a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="st0">&quot;CREATE TABLE `new_table` (`id` int NOT NULL AUTO_INCREMENT,`name` varchar(25),`age` int, PRIMARY KEY(id))&quot;</span>,<span class="re0">$conn</span><span class="br0">&#41;</span> or <a href="http://www.php.net/die"><span class="kw3">die</span></a><span class="br0">&#40;</span><a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
&nbsp;</div>
<p>This code will create a table with 3 fields in (id - which is the primary key, name which allows up to 25 alphanumeric characters and age that allows an integer) .</p>
<p><strong>Retrieving data from a MySQL table</strong></p>
<p>I am going to show you a basic way of getting data from a table when you know all the field names of that database.<br />
There are numerous ways of doing this (look into mysql_fetch_assoc() and mysql_fetch_array())</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="re0">$select</span> = <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="st0">&quot;SELECT `id`,`name`,`age` FROM `new_table`&quot;</span><span class="br0">&#41;</span> or <a href="http://www.php.net/die"><span class="kw3">die</span></a> <span class="br0">&#40;</span><a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
<span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/mysql_num_rows"><span class="kw3">mysql_num_rows</span></a><span class="br0">&#40;</span><span class="re0">$select</span><span class="br0">&#41;</span> &gt; <span class="nu0">0</span><span class="br0">&#41;</span><br />
&nbsp;<span class="br0">&#123;</span><br />
&nbsp;<span class="kw1">while</span> <span class="br0">&#40;</span><a href="http://www.php.net/list"><span class="kw3">list</span></a><span class="br0">&#40;</span><span class="re0">$_id</span>,<span class="re0">$_name</span>,<span class="re0">$_age</span><span class="br0">&#41;</span> = <a href="http://www.php.net/mysql_fetch_array"><span class="kw3">mysql_fetch_array</span></a><span class="br0">&#40;</span><span class="re0">$select</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="co1">//gets the data from the SELECT query and puts it into variables</span><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;The ID for this record is: &quot;</span> . <span class="re0">$_id</span> . <span class="st0">&quot;<span class="es0">\n</span>&quot;</span>;<br />
&nbsp; &nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;The Name for this record is: &quot;</span> . <span class="re0">$_name</span> . <span class="st0">&quot;<span class="es0">\n</span>&quot;</span>;<br />
&nbsp; &nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;The Age for this record is: &quot;</span> . <span class="re0">$_age</span> . <span class="st0">&quot;<span class="es0">\n</span>&quot;</span>;<br />
&nbsp; <span class="br0">&#125;</span> <br />
&nbsp;<span class="br0">&#125;</span><br />
<span class="kw1">else</span><br />
&nbsp;<span class="br0">&#123;</span><br />
&nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;There are no records to display&quot;</span>;<br />
&nbsp;<span class="br0">&#125;</span><br />
&nbsp;</div>
<p>The above example is the way I sometimes chose to do my SELECT queries because it is quite self explanatory with the variables. I would not recommend this method however if you have a lot of variables in your script as it could pose problems with overwriting variables.</p>
<p>This is another way of performing the same query:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="re0">$select</span> = <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="st0">&quot;SELECT * FROM `new_table`&quot;</span><span class="br0">&#41;</span> or <a href="http://www.php.net/die"><span class="kw3">die</span></a> <span class="br0">&#40;</span><a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
<span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/mysql_num_rows"><span class="kw3">mysql_num_rows</span></a><span class="br0">&#40;</span><span class="re0">$select</span><span class="br0">&#41;</span> &gt; <span class="nu0">0</span><span class="br0">&#41;</span><br />
&nbsp;<span class="br0">&#123;</span><br />
&nbsp;<span class="kw1">while</span> <span class="br0">&#40;</span><span class="re0">$row</span> = <a href="http://www.php.net/mysql_fetch_assoc"><span class="kw3">mysql_fetch_assoc</span></a><span class="br0">&#40;</span><span class="re0">$select</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="co1">//gets the data from the SELECT query and puts it into the $row array</span><br />
&nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;The ID for this record is: &quot;</span> . <span class="re0">$row</span><span class="br0">&#91;</span><span class="st0">'id'</span><span class="br0">&#93;</span> . <span class="st0">&quot;<span class="es0">\n</span>&quot;</span>;<br />
&nbsp; &nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;The Name for this record is: &quot;</span> . &nbsp;<span class="re0">$row</span><span class="br0">&#91;</span><span class="st0">'name'</span><span class="br0">&#93;</span> . <span class="st0">&quot;<span class="es0">\n</span>&quot;</span>;<br />
&nbsp; &nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;The Age for this record is: &quot;</span> . &nbsp;<span class="re0">$row</span><span class="br0">&#91;</span><span class="st0">'age'</span><span class="br0">&#93;</span> . <span class="st0">&quot;<span class="es0">\n</span>&quot;</span>;<br />
&nbsp; <span class="br0">&#125;</span> <br />
&nbsp;<span class="br0">&#125;</span><br />
<span class="kw1">else</span><br />
&nbsp;<span class="br0">&#123;</span><br />
&nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;There are no records to display&quot;</span>;<br />
&nbsp;<span class="br0">&#125;</span><br />
&nbsp;</div>
<p>The above does the same thing as the example beforehand, but utilizes only one variable.</p>
<p><strong>Deleting data from a MySQL table</strong><br />
The DELETE query is extremely simple. You simply define the table from which you'd like to delete a record, and specify a record. In this case we are specifying the record with an id of 1.</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="re0">$del</span> = <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="st0">&quot;DELETE FROM `new_table` WHERE `id`= '1' &quot;</span>,<span class="re0">$conn</span><span class="br0">&#41;</span> or <a href="http://www.php.net/die"><span class="kw3">die</span></a><span class="br0">&#40;</span><a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;<br />
<span class="kw1">if</span> <span class="br0">&#40;</span><a href="http://www.php.net/mysql_affected_rows"><span class="kw3">mysql_affected_rows</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span> == <span class="nu0">1</span><span class="br0">&#41;</span><br />
&nbsp;<span class="br0">&#123;</span><br />
&nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;Record Deleted&quot;</span>;<br />
&nbsp;<span class="br0">&#125;</span><br />
<span class="kw1">else</span><br />
&nbsp;<span class="br0">&#123;</span><br />
&nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;There was a problem deleting the specified record.&quot;</span>;<br />
&nbsp;<span class="br0">&#125;</span><br />
&nbsp;</div>
<p><strong>Dropping a table from a MySQL database</strong><br />
If you would like to remove a table and all its data from a MySQL database then use the following code:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="re0">$drop</span> = <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="st0">&quot;DROP TABLE `new_table` &quot;</span>,<span class="re0">$conn</span><span class="br0">&#41;</span> or <a href="http://www.php.net/die"><span class="kw3">die</span></a><span class="br0">&#40;</span><a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>; <br />
&nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$drop</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp;<span class="br0">&#123;</span> <br />
&nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;new_table has been dropped from the database.&quot;</span>;<br />
&nbsp; &nbsp;<span class="br0">&#125;</span><br />
&nbsp;</div>
<p><strong>Inserting data into a table</strong><br />
Inserting data into a table is extremely simple.</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="re0">$insert</span> = <a href="http://www.php.net/mysql_query"><span class="kw3">mysql_query</span></a><span class="br0">&#40;</span><span class="st0">&quot;INSERT INTO `tblname` (`name`,`username`,`email`) VALUES ('Andrew','papa_face','someone@somewhere.com')&quot;</span>,<span class="re0">$conn</span><span class="br0">&#41;</span> or <a href="http://www.php.net/die"><span class="kw3">die</span></a><span class="br0">&#40;</span><a href="http://www.php.net/mysql_error"><span class="kw3">mysql_error</span></a><span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>; <br />
&nbsp; <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$insert</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp;<span class="br0">&#123;</span> <br />
&nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;The record has been inserted into the database.&quot;</span>;<br />
&nbsp; &nbsp;<span class="br0">&#125;</span><br />
&nbsp;</div>
<p>Of course you can make insert queries dynamic by using variables, but that is one quick and easy example of how to insert data into a table <img src='http://www.papaface.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .</p>
<p>And that's it!<br />
I hope this blog post have been very informative. Any questions or comments are greatly appreciated.<br />
Thanks for reading!<br />
<span class="slashdigglicious"><br />
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F15%2Fmysql-connecting-selecting-and-more%2F&amp;title=MySQL+%26%238211%3B+Connecting%2C+Selecting%26%238230%3B.+and+more." title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a><br />
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F15%2Fmysql-connecting-selecting-and-more%2F&amp;title=MySQL+%26%238211%3B+Connecting%2C+Selecting%26%238230%3B.+and+more." title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a><br />
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F15%2Fmysql-connecting-selecting-and-more%2F&amp;title=MySQL+%26%238211%3B+Connecting%2C+Selecting%26%238230%3B.+and+more." title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a><br />
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F15%2Fmysql-connecting-selecting-and-more%2F&amp;title=MySQL+%26%238211%3B+Connecting%2C+Selecting%26%238230%3B.+and+more." title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F15%2Fmysql-connecting-selecting-and-more%2F&amp;title=MySQL+%26%238211%3B+Connecting%2C+Selecting%26%238230%3B.+and+more.', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a><br />
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F15%2Fmysql-connecting-selecting-and-more%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a><br />
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F15%2Fmysql-connecting-selecting-and-more%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a><br />
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F15%2Fmysql-connecting-selecting-and-more%2F&amp;title=MySQL+%26%238211%3B+Connecting%2C+Selecting%26%238230%3B.+and+more." title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a><br />
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F15%2Fmysql-connecting-selecting-and-more%2F&amp;title=MySQL+%26%238211%3B+Connecting%2C+Selecting%26%238230%3B.+and+more." title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.papaface.com/blog/2008/01/15/mysql-connecting-selecting-and-more/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sanitizing $_POST and $_GET</title>
		<link>http://www.papaface.com/blog/2008/01/13/sanitizing-_post-and-_get/</link>
		<comments>http://www.papaface.com/blog/2008/01/13/sanitizing-_post-and-_get/#comments</comments>
		<pubDate>Sun, 13 Jan 2008 23:32:16 +0000</pubDate>
		<dc:creator>papa_face</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[escape]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[sanitize]]></category>

		<guid isPermaLink="false">http://www.papaface.com/blog/2008/01/13/sanitizing-_post-and-_get/</guid>
		<description><![CDATA[Hey, Well I haven't posted something PHP related for quite a few days now so I thought I'd show you something I use in every single script that I write that involves form submissions or URL data. It is important to escape (sanitize) all data from forms that may be used in a mysql database [...]]]></description>
			<content:encoded><![CDATA[<p>Hey,<br />
Well I haven't posted something PHP related for quite a few days now so I thought I'd show you something I use in every single script that I write that involves form submissions or URL data.<br />
It is important to escape (sanitize) all data from forms that may be used in a mysql database query.<br />
If you use some other database type, the function can easily be modified.</p>
<p>Place this code at the top of all your pages (maybe via an include):</p>
<div class="dean_ch" style="white-space: wrap;">
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>!<a href="http://www.php.net/function_exists"><span class="kw3">function_exists</span></a><span class="br0">&#40;</span>mysql_real_escape_array<span class="br0">&#41;</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">function</span> mysql_real_escape_array<span class="br0">&#40;</span><span class="re0">$t</span><span class="br0">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <a href="http://www.php.net/array_map"><span class="kw3">array_map</span></a><span class="br0">&#40;</span><span class="st0">&quot;mysql_real_escape_string&quot;</span>,<span class="re0">$t</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; mysql_real_escape_array<span class="br0">&#40;</span><span class="re0">$_GET</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; mysql_real_escape_array<span class="br0">&#40;</span><span class="re0">$_POST</span><span class="br0">&#41;</span>;<br />
&nbsp;</div>
<p>It will automatically sanitize all your $_POST (from forms) and $_GET (URL data) to help prevent SQL injections.</p>
<p>Be aware though, that this is just one precaution you should take when inserting data into a mysql database.<br />
<span class="slashdigglicious"><br />
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F13%2Fsanitizing-_post-and-_get%2F&amp;title=Sanitizing+%24_POST+and+%24_GET" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a><br />
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F13%2Fsanitizing-_post-and-_get%2F&amp;title=Sanitizing+%24_POST+and+%24_GET" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a><br />
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F13%2Fsanitizing-_post-and-_get%2F&amp;title=Sanitizing+%24_POST+and+%24_GET" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a><br />
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F13%2Fsanitizing-_post-and-_get%2F&amp;title=Sanitizing+%24_POST+and+%24_GET" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F13%2Fsanitizing-_post-and-_get%2F&amp;title=Sanitizing+%24_POST+and+%24_GET', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a><br />
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F13%2Fsanitizing-_post-and-_get%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a><br />
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F13%2Fsanitizing-_post-and-_get%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a><br />
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F13%2Fsanitizing-_post-and-_get%2F&amp;title=Sanitizing+%24_POST+and+%24_GET" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a><br />
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F13%2Fsanitizing-_post-and-_get%2F&amp;title=Sanitizing+%24_POST+and+%24_GET" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.papaface.com/blog/2008/01/13/sanitizing-_post-and-_get/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FORTRAN and Other Programming Languages from the 50â€™s</title>
		<link>http://www.papaface.com/blog/2008/01/13/fortran-and-other-programming-languages-from-the-50%e2%80%99s/</link>
		<comments>http://www.papaface.com/blog/2008/01/13/fortran-and-other-programming-languages-from-the-50%e2%80%99s/#comments</comments>
		<pubDate>Sun, 13 Jan 2008 06:33:40 +0000</pubDate>
		<dc:creator>nabanita</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[COBOL]]></category>
		<category><![CDATA[FORTRAN]]></category>
		<category><![CDATA[LISP]]></category>

		<guid isPermaLink="false">http://www.papaface.com/blog/2008/01/13/fortran-and-other-programming-languages-from-the-50%e2%80%99s/</guid>
		<description><![CDATA[FORTRAN-FORmula TRANslating system was invented in the year 1957. The language was very easy to use as it contained limited commands like GOTO, IF and DO. FORTRAN paved the way for todayâ€™s languages as it contained basic data types like integer, double precision, logical variables and real numbers which are very much used in todayâ€™s [...]]]></description>
			<content:encoded><![CDATA[<p>FORTRAN-FORmula TRANslating system was invented in the year 1957. The language was very easy to use as it contained limited commands like GOTO, IF and DO. FORTRAN paved the way for todayâ€™s languages as it contained basic data types like integer, double precision, logical variables and real numbers which are very much used in todayâ€™s languages.</p>
<p>As in those days people were only looking for solving mathematical operations via programming languages, FORTRAN was a result of that need. This is why FORTRAN was amazing with numbers but was not the same in other areas, like handling input and output. As a result the language was not famous amongst businesses. When computers started getting into the businesses in the year 1959 A.D. the need for another language arose. </p>
<p>This is why COBOL was invented. From the beginning itself, COBOL was developed as a businessmanâ€™s language. The language was easier than FORTRAN to understand as it had only two types of data types; strings and numbers. The main feature of COBOL was to handle records, as businesses needed to keep an account of previous records. COBOL statements were related to the English language. This made it very easy for the businessman to get the grasp of the language better and they were able to adapt it easily.</p>
<p>In the year 1958 A.D. a new type of language was designed. It was called LISP-LISt Processing language. The main reason for the invention of this language was to explore the field of artificial intelligence. Syntax of the language was different from all the existing languages as the language dealt with a completely new area of concern. As the name suggests, the program in the LISP language are written as a set of lists that represents series of items. As a result of this the LISP programs have a distinctive ability to modify itself from time to time and consequently to develop on its own.<br />
<span class="slashdigglicious"><br />
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F13%2Ffortran-and-other-programming-languages-from-the-50%25e2%2580%2599s%2F&amp;title=FORTRAN+and+Other+Programming+Languages+from+the+50%C3%A2%E2%82%AC%E2%84%A2s" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a><br />
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F13%2Ffortran-and-other-programming-languages-from-the-50%25e2%2580%2599s%2F&amp;title=FORTRAN+and+Other+Programming+Languages+from+the+50%C3%A2%E2%82%AC%E2%84%A2s" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a><br />
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F13%2Ffortran-and-other-programming-languages-from-the-50%25e2%2580%2599s%2F&amp;title=FORTRAN+and+Other+Programming+Languages+from+the+50%C3%A2%E2%82%AC%E2%84%A2s" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a><br />
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F13%2Ffortran-and-other-programming-languages-from-the-50%25e2%2580%2599s%2F&amp;title=FORTRAN+and+Other+Programming+Languages+from+the+50%C3%A2%E2%82%AC%E2%84%A2s" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F13%2Ffortran-and-other-programming-languages-from-the-50%25e2%2580%2599s%2F&amp;title=FORTRAN+and+Other+Programming+Languages+from+the+50%C3%A2%E2%82%AC%E2%84%A2s', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a><br />
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F13%2Ffortran-and-other-programming-languages-from-the-50%25e2%2580%2599s%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a><br />
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F13%2Ffortran-and-other-programming-languages-from-the-50%25e2%2580%2599s%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a><br />
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F13%2Ffortran-and-other-programming-languages-from-the-50%25e2%2580%2599s%2F&amp;title=FORTRAN+and+Other+Programming+Languages+from+the+50%C3%A2%E2%82%AC%E2%84%A2s" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a><br />
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F13%2Ffortran-and-other-programming-languages-from-the-50%25e2%2580%2599s%2F&amp;title=FORTRAN+and+Other+Programming+Languages+from+the+50%C3%A2%E2%82%AC%E2%84%A2s" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.papaface.com/blog/2008/01/13/fortran-and-other-programming-languages-from-the-50%e2%80%99s/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Beginning of PHP</title>
		<link>http://www.papaface.com/blog/2008/01/07/the-beginning-of-php/</link>
		<comments>http://www.papaface.com/blog/2008/01/07/the-beginning-of-php/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 03:26:45 +0000</pubDate>
		<dc:creator>nabanita</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[origins]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Rasmus]]></category>

		<guid isPermaLink="false">http://www.papaface.com/blog/2008/01/07/the-beginning-of-php/</guid>
		<description><![CDATA[PHP &#8211; Hypertext preprocessor is basically a computer coding language. The language was designed by Rasmus Lerdorf and was developed by the PHP group. PHP was created in 1994 by Rasmus Lerdorf to help maintain his personal homepage. He had written a bunch of Common Gateway Interface (CGI) binaries via the C coding language and [...]]]></description>
			<content:encoded><![CDATA[<p>PHP &#8211; Hypertext preprocessor is basically a computer coding language. The language was designed by Rasmus Lerdorf and was developed by the PHP group. PHP was created in 1994 by Rasmus Lerdorf to help maintain his personal homepage. </p>
<p>He had written a bunch of Common Gateway Interface (CGI) binaries via the C coding language and wanted to restore a trivial set of Perl scripts which he had been using to preserve his homepage by the CGI. He wanted to do this in order to check the traffic on his homepage. This later was released publicly as the first ever version of Hypertext Preprocessor on 8 June, 1995 named PHP/FI (Form Interpreter).</p>
<p>One would wonder why there is an extra letter P in the abbreviation. The reason being the language is initialized again and again, recursively and thatâ€™s why the abbreviation PHP. PHP is an essential, object-oriented language. PHP is extensively used as an all-purpose scripting language, which is particularly fitting for web development. The working of PHP is simple. PHP essentially uses a web server to run, which takes the PHP code as input and results in web pages as output.</p>
<p>PHP was originally created for designing dynamic web pages. Over the years the main focus of PHP has changed. Server side scripting is the spotlight of PHP now. Moreover PHP has been declared as free software by the free software association. It is available over the internet and any one can download it. Due to this reason PHP stands out in comparison with competitors like Microsoftâ€™s ASP.NET system, mod_perl framework and Sun Microsystemsâ€™ JavaServer Pages as they are not free. The PHP parser can run with both, a web browser and a web server which help in providing dynamic content.<br />
The following is a simple Hello World code example for PHP:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?php</span><br />
<a href="http://www.php.net/echo"><span class="kw3">Echo</span></a> â€™Hello World!â€™;<br />
<span class="kw2">?&gt;</span><br />
&nbsp;</div>
<p><span class="slashdigglicious"><br />
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F07%2Fthe-beginning-of-php%2F&amp;title=The+Beginning+of+PHP" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a><br />
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F07%2Fthe-beginning-of-php%2F&amp;title=The+Beginning+of+PHP" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a><br />
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F07%2Fthe-beginning-of-php%2F&amp;title=The+Beginning+of+PHP" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a><br />
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F07%2Fthe-beginning-of-php%2F&amp;title=The+Beginning+of+PHP" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F07%2Fthe-beginning-of-php%2F&amp;title=The+Beginning+of+PHP', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a><br />
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F07%2Fthe-beginning-of-php%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a><br />
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F07%2Fthe-beginning-of-php%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a><br />
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F07%2Fthe-beginning-of-php%2F&amp;title=The+Beginning+of+PHP" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a><br />
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F07%2Fthe-beginning-of-php%2F&amp;title=The+Beginning+of+PHP" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.papaface.com/blog/2008/01/07/the-beginning-of-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP &#8211; The Basics &#8211; Tags, echo and if/else</title>
		<link>http://www.papaface.com/blog/2008/01/07/php-the-basics-tags-echo-and-ifelse/</link>
		<comments>http://www.papaface.com/blog/2008/01/07/php-the-basics-tags-echo-and-ifelse/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 02:32:36 +0000</pubDate>
		<dc:creator>papa_face</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.papaface.com/blog/2008/01/07/php-the-basics-tags-echo-and-ifelse/</guid>
		<description><![CDATA[One of the most basic things when writing code in PHP is to use the PHP tags which signify the beginning and the ending of the PHP code. You must have the tags in order for PHP to process the code you write. The tags are: beginning tag: &#60;?php ending tag: ?&#62; e.g &#60;?php //code [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most basic things when writing code in PHP is to use the PHP tags which signify the beginning and the ending of the PHP code. You must have the tags in order for PHP to process the code you write. The tags are:</p>
<p>beginning tag:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?php</span></div>
<p>ending tag:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">?&gt;</span></div>
<p>e.g</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?php</span><br />
<span class="co1">//code here</span><br />
<span class="kw2">?&gt;</span><br />
&nbsp;</div>
<p>You can have anything proceeding/preceding the PHP tags, but anything in between them must be valid PHP.</p>
<p>I advise you to <strong>only</strong> use the tags that I have stated above. Try not to use tags like:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?</span> <br />
<span class="co1">//some code</span><br />
<span class="kw2">?&gt;</span></div>
<p>or</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?</span>= <span class="st0">&quot;Hello!&quot;</span> <span class="kw2">?&gt;</span><br />
&nbsp;</div>
<p>Shorthand tags are not 100% compatible on 100% of servers, however:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?php</span><br />
<span class="co1">//some code</span><br />
<span class="kw2">?&gt;</span></div>
<p>is! <img src='http://www.papaface.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>We&#8217;ll start with something pretty simple and it is the echo statement.<br />
This is an example of the echo statement:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?php</span><br />
<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;Hello you!&quot;</span>;<br />
<span class="kw2">?&gt;</span><br />
&nbsp;</div>
<p>When the script is run, the page will display &#8220;Hello you!&#8221;.<br />
Notice the semicolon? The semicolon (;) is a line terminator. It tells PHP that you are finished with that particular set of instructions, and that PHP can continue with the script until it reaches the end. If the semicolon is not present at the end of instructions/commands/statements/variables a error may be triggered as a result.</p>
<p>Now lets move on to something a little more useful, the if/else statement.</p>
<p>This is an example of an if/else statement:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?php</span><br />
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="nu0">5</span> &gt; <span class="nu0">10</span><span class="br0">&#41;</span><br />
&nbsp;<span class="br0">&#123;</span><br />
&nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;5 is greater than 10&quot;</span>;<br />
&nbsp;<span class="br0">&#125;</span><br />
<span class="kw1">else</span><br />
&nbsp;<span class="br0">&#123;</span><br />
&nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;5 is not greater than 10&quot;</span>;<br />
&nbsp;<span class="br0">&#125;</span><br />
<span class="kw2">?&gt;</span><br />
&nbsp;</div>
<p>Okay with an if statement you must define the conditions of the <strong>if</strong> between the brackets. The aim of an if statement, is to get <strong>true</strong> returned (a boolean). If the condition returns false, then it will run the code in the else statement (if there is one).</p>
<p>In the code above the if statement will return false and display &#8220;5 is not greater than 10&#8243; &#8211; understand?</p>
<p>Yeah its pretty easy at this level.<br />
If I used this code:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?php</span><br />
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="nu0">5</span> &lt; <span class="nu0">10</span><span class="br0">&#41;</span><br />
&nbsp;<span class="br0">&#123;</span><br />
&nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;5 is less than 10&quot;</span>;<br />
&nbsp;<span class="br0">&#125;</span><br />
<span class="kw1">else</span><br />
&nbsp;<span class="br0">&#123;</span><br />
&nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;5 is NOT less than 10&quot;</span>;<br />
&nbsp;<span class="br0">&#125;</span><br />
<span class="kw2">?&gt;</span><br />
&nbsp;</div>
<p>The if statement would return true, and therefore we would get &#8220;5 is less than 10&#8243; printed out on the page.</p>
<p>When writing an if statement there are two important parts. </p>
<ol>
<li>The condition &#8211; this is contained in between brackets (5 < 10)</li>
<li>The curly braces &#8211; { } &#8211; the code you want to execute should be placed in between the two curly braces. The only exception to this is when you only have one line of instructions like this:
</li>
</ol>
<div class="dean_ch" style="white-space: wrap;">
<span class="kw2">&lt;?php</span><br />
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="nu0">5</span> &lt; <span class="nu0">10</span><span class="br0">&#41;</span><br />
<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;5 is less than 10&quot;</span>;<br />
<span class="kw2">?&gt;</span><br />
&nbsp;</div>
<p>That concludes this part of my help guide I hope it was useful to those starting to learn PHP.<br />
If you want to look into the if/else statement more, look into <a href="http://uk2.php.net/elseif">elseif</a>. The PHP manual is a great resource, so make good use of it. It contains <strong>everything</strong> you need to know about PHP (literally).</p>
<p>Feel free to comment on this post, I appreciate all the comments I receive! <img src='http://www.papaface.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
<span class="slashdigglicious"><br />
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F07%2Fphp-the-basics-tags-echo-and-ifelse%2F&amp;title=PHP+%26%238211%3B+The+Basics+%26%238211%3B+Tags%2C+echo+and+if%2Felse" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a><br />
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F07%2Fphp-the-basics-tags-echo-and-ifelse%2F&amp;title=PHP+%26%238211%3B+The+Basics+%26%238211%3B+Tags%2C+echo+and+if%2Felse" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a><br />
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F07%2Fphp-the-basics-tags-echo-and-ifelse%2F&amp;title=PHP+%26%238211%3B+The+Basics+%26%238211%3B+Tags%2C+echo+and+if%2Felse" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a><br />
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F07%2Fphp-the-basics-tags-echo-and-ifelse%2F&amp;title=PHP+%26%238211%3B+The+Basics+%26%238211%3B+Tags%2C+echo+and+if%2Felse" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F07%2Fphp-the-basics-tags-echo-and-ifelse%2F&amp;title=PHP+%26%238211%3B+The+Basics+%26%238211%3B+Tags%2C+echo+and+if%2Felse', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a><br />
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F07%2Fphp-the-basics-tags-echo-and-ifelse%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a><br />
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F07%2Fphp-the-basics-tags-echo-and-ifelse%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a><br />
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F07%2Fphp-the-basics-tags-echo-and-ifelse%2F&amp;title=PHP+%26%238211%3B+The+Basics+%26%238211%3B+Tags%2C+echo+and+if%2Felse" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a><br />
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F07%2Fphp-the-basics-tags-echo-and-ifelse%2F&amp;title=PHP+%26%238211%3B+The+Basics+%26%238211%3B+Tags%2C+echo+and+if%2Felse" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.papaface.com/blog/2008/01/07/php-the-basics-tags-echo-and-ifelse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data Types in PHP</title>
		<link>http://www.papaface.com/blog/2008/01/06/data-types-in-php/</link>
		<comments>http://www.papaface.com/blog/2008/01/06/data-types-in-php/#comments</comments>
		<pubDate>Sun, 06 Jan 2008 17:24:58 +0000</pubDate>
		<dc:creator>papa_face</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[boolean]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[datatypes]]></category>
		<category><![CDATA[easy]]></category>
		<category><![CDATA[integer]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[string]]></category>
		<category><![CDATA[type]]></category>

		<guid isPermaLink="false">http://www.papaface.com/blog/2008/01/06/data-types-in-php/</guid>
		<description><![CDATA[PHP is not a very strict language when it comes down to data types. Strings: $string = &#34;This is a string&#34;; &#160; Strings are values that contain characters. This can include basically everything you can type on your keyboard. Integers: $string = 1; &#160; Integers are values that just contain numbers. Notice in the example [...]]]></description>
			<content:encoded><![CDATA[<p>PHP is not a very strict language when it comes down to data types.<br />
Strings:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="re0">$string</span> = <span class="st0">&quot;This is a string&quot;</span>;<br />
&nbsp;</div>
<p>Strings are values that contain characters. This can include basically everything you can type on your keyboard.</p>
<p>Integers:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="re0">$string</span> = <span class="nu0">1</span>;<br />
&nbsp;</div>
<p>Integers are values that just contain numbers. Notice in the example above that there are no quotes?<br />
Well, you can write an integer like that, or like this:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="re0">$string</span> = <span class="st0">&quot;1&quot;</span>;<br />
&nbsp;</div>
<p>PHP automatically converts numbers contained in a string with no other characters into a integer. The only time you need to be careful of this is when you are using operators (I will discuss that in another post).</p>
<p>Boolean:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="re0">$string</span> = <span class="kw2">true</span>;<br />
<span class="re0">$string2</span> = <span class="kw2">false</span>;<br />
&nbsp;</div>
<p>Booleans are values that contain either true or false. They can be used in if statements like:</p>
<div class="dean_ch" style="white-space: wrap;">
<span class="re0">$string</span> = <span class="kw2">true</span>;<br />
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$string</span><span class="br0">&#41;</span><span class="co1">//checks if $string is true</span><br />
&nbsp;<span class="br0">&#123;</span><br />
&nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">'$string is true'</span>;<br />
&nbsp;<span class="br0">&#125;</span><br />
<span class="kw1">else</span><br />
&nbsp;<span class="br0">&#123;</span><br />
&nbsp;<a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">'$string is false'</span>;<br />
&nbsp;<span class="br0">&#125;</span><br />
&nbsp;</div>
<p>Hope that helps you understand data types in PHP better. Obviously I have just scratched the surface in my explanations.<br />
Feel free to comment and ask any questions <img src='http://www.papaface.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /><br />
<span class="slashdigglicious"><br />
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F06%2Fdata-types-in-php%2F&amp;title=Data+Types+in+PHP" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a><br />
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F06%2Fdata-types-in-php%2F&amp;title=Data+Types+in+PHP" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a><br />
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F06%2Fdata-types-in-php%2F&amp;title=Data+Types+in+PHP" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a><br />
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F06%2Fdata-types-in-php%2F&amp;title=Data+Types+in+PHP" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F06%2Fdata-types-in-php%2F&amp;title=Data+Types+in+PHP', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a><br />
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F06%2Fdata-types-in-php%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a><br />
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F06%2Fdata-types-in-php%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a><br />
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F06%2Fdata-types-in-php%2F&amp;title=Data+Types+in+PHP" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a><br />
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.papaface.com%2Fblog%2F2008%2F01%2F06%2Fdata-types-in-php%2F&amp;title=Data+Types+in+PHP" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a><br />
</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.papaface.com/blog/2008/01/06/data-types-in-php/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

