<?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>Architect, Engineer, Tech Enthusiast - Hasan Otuome &#187; PHP</title>
	<atom:link href="http://technophi.com/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://technophi.com</link>
	<description>personal weblog of a tech addict</description>
	<lastBuildDate>Wed, 23 Nov 2011 18:04:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>PHP Documentation Tips</title>
		<link>http://technophi.com/2010/07/06/php-documentation-tips/</link>
		<comments>http://technophi.com/2010/07/06/php-documentation-tips/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 01:08:29 +0000</pubDate>
		<dc:creator>Hasan Otuome</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://technophi.com/?p=509</guid>
		<description><![CDATA[Recently had to run PhpDocumentor on a project only to be faced with broken documentation after bringing all class files into compliance with proper comments. At first I thought I was missing a config flag for the command-line but, it turns out that the PhpDocumentor-1.4.3 ZIP download contains broken template elements. In the following screenshot, [...]]]></description>
			<content:encoded><![CDATA[<p>Recently had to run <a href="http://www.phpdoc.org/">PhpDocumentor</a> on a project only to be faced with broken documentation after bringing all class files into compliance with proper comments. At first I thought I was missing a config flag for the command-line but, it turns out that the PhpDocumentor-1.4.3 ZIP download contains broken template elements. In the following screenshot, notice how some CSS files have a .cs extenstion and some TPL files have a .tp extension. </p>
<p><a href="http://technophi.com/wp-content/uploads/ol_phpdoc_broken_download_20100706.png"><img src="http://technophi.com/wp-content/uploads/ol_phpdoc_broken_download_20100706-300x199.png" alt="" title="PHPDoc Broken Download" width="300" height="199" class="aligncenter size-medium wp-image-510" /></a></p>
<p>Some GIF, JS and PNG files also had the wrong extension. Once I realized that was the issue, I made use of this handy little tool, <a href="http://www.renamer.com">Renamer</a>, to allow me to run a batch rename on the contents of the HTML folder which holds all the template files. </p>
<p><a href="http://renamer.com/images/screenshot_main_window.jpg"><img src="http://renamer.com/images/screenshot_main_window.jpg"  class="aligncenter size-medium wp-image-510" alt="Renamer for OSX" width="300" height="199" /></a></p>
<p>After the file names were fixed, it was just a matter of adding the images that were missing from the default theme and the generated docs were finally legible. Next step, create a custom theme using the default as a base and make these docs a little prettier <img src='http://technophi.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<div style="float: right; padding: 3px;"><a href="http://bufferapp.com/add" class="buffer-add-button" data-text="PHP Documentation Tips" data-url="http://technophi.com/2010/07/06/php-documentation-tips/" data-via="bufferapp" data-count="none">Buffer</a><script type="text/javascript" src="http://static.bufferapp.com/js/button.js"></script></div><div id="tweetbutton509" class="tw_button" style="padding: 3px;float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fj.mp%2FmfVo2q&amp;via=heroizm&amp;text=PHP%20Documentation%20Tips&amp;related=heroizm&amp;lang=en&amp;count=none&amp;counturl=http%3A%2F%2Ftechnophi.com%2F2010%2F07%2F06%2Fphp-documentation-tips%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://technophi.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://technophi.com/2010/07/06/php-documentation-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ZamfBrowser &#8211; ZendAMF Service Browser</title>
		<link>http://technophi.com/2009/11/13/zamfbrowser-zendamf-service-browser/</link>
		<comments>http://technophi.com/2009/11/13/zamfbrowser-zendamf-service-browser/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Hasan Otuome</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[OSX Server]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ZendAmf]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<a href="http://www.zamfbrowser.org"><img src="http://www.zamfbrowser.org/images/zamfbrowser.png"/></a>
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.zamfbrowser.org"><img src="http://www.zamfbrowser.org/images/zamfbrowser.png"/></a></p>
<p>One of my colleagues at <a href="http://almerblank.com"><b>Almer/Blank</b></a>, Omar Gonzalez, just released a very promising project into the open source community today, <a href="http://www.zamfbrowser.org/"><b>ZamfBrowser</b></a>. This AIR application is a lifeline for all the developers who have embraced <a href="http://framework.zend.com/manual/en/zend.amf.html"><b>ZendAMF</b></a> since its release yet have longed for that familiar service browser paradigm we grew used to with AMFPHP. Well, wait no longer. ZamfBrowser performs server introspection to give you access to your ZendAMF services and it even features test retention by remembering the last arguments used for method testing between sessions. This is definitely an application worth a look if you plan on doing any AMF development.</p>
<div style="float: right; padding: 3px;"><a href="http://bufferapp.com/add" class="buffer-add-button" data-text="ZamfBrowser &#8211; ZendAMF Service Browser" data-url="http://technophi.com/2009/11/13/zamfbrowser-zendamf-service-browser/" data-via="bufferapp" data-count="none">Buffer</a><script type="text/javascript" src="http://static.bufferapp.com/js/button.js"></script></div><div id="tweetbutton106" class="tw_button" style="padding: 3px;float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fj.mp%2Fk9KkoC&amp;via=heroizm&amp;text=ZamfBrowser%20%26%238211%3B%20ZendAMF%20Service%20Browser&amp;related=heroizm&amp;lang=en&amp;count=none&amp;counturl=http%3A%2F%2Ftechnophi.com%2F2009%2F11%2F13%2Fzamfbrowser-zendamf-service-browser%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://technophi.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://technophi.com/2009/11/13/zamfbrowser-zendamf-service-browser/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>AMFPHP Fatal Errors After PHP 5.3 Upgrade (Part 2)</title>
		<link>http://technophi.com/2009/10/16/amfphp-fatal-errors-after-php-5-3-upgrade-part-2/</link>
		<comments>http://technophi.com/2009/10/16/amfphp-fatal-errors-after-php-5-3-upgrade-part-2/#comments</comments>
		<pubDate>Fri, 16 Oct 2009 13:18:05 +0000</pubDate>
		<dc:creator>Hasan Otuome</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[As promised in <b><a href="http://redmachine.net/media/AMFPHP-Fatal-Errors-After-PHP-5.3-Upgrade-part-1">Part 1</a></b>, I'm documenting yet another issue that must be addressed in your <b><a href="http://amfphp.org">AMFPHP</a></b> installation upon upgrading to PHP 5.3. This issue stems from the usage of the [code lang="php"]eregi_replace[/code] function that has been deprecated in PHP 5.3. If you run into a fatal error in your AMFPHP application with the message [code]Function eregi_replace() is deprecated[/code], you have (2) options:

<ol>
]]></description>
			<content:encoded><![CDATA[<p>As promised in <b><a href="http://redmachine.net/media/AMFPHP-Fatal-Errors-After-PHP-5.3-Upgrade-part-1">Part 1</a></b>, I&#8217;m documenting yet another issue that must be addressed in your <b><a href="http://amfphp.org">AMFPHP</a></b> installation upon upgrading to PHP 5.3. This issue stems from the usage of the [code lang="php"]eregi_replace[/code] function that has been deprecated in PHP 5.3. If you run into a fatal error in your AMFPHP application with the message [code]Function eregi_replace() is deprecated[/code], you have (2) options:</p>
<ol>
<li>Modify your PHP configuration to disable the warnings</li>
<li>Replace the deprecated code with the new, recommended equivalent</li>
</ol>
<p>I&#8217;d advise against #1 since you will also lose warning and error notices that could be helpful to you during development. And, by choosing #2 you will be bringing the AMFPHP code into compliance with a change that is also backwards-compatible with previous versions of PHP since the replacement function you&#8217;re going to use has been around since PHP 4. </p>
<p>So, to update your AMFPHP source, you need to modify [code]MethodTable.php[/code] which can be found @ [code]/path/to/amfphp/core/shared/util/MethodTable.php[/code]. Open up this file in your favorite text editor (ie, <b><a href="http://macromates.com/">TextMate</a></b> <img src='http://technophi.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) and jump to line 505. Once there, you need to replace these three lines:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$comment</span> <span style="color: #339933;">=</span> <span style="color: #990000;">eregi_replace</span><span style="color: #009900;">&#40;</span>”\n<span style="color: #009900;">&#91;</span> \t<span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span>”<span style="color: #339933;">,</span> “\n”<span style="color: #339933;">,</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$comment</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span>”\n”<span style="color: #339933;">,</span> “\\n”<span style="color: #339933;">,</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$comment</span> <span style="color: #339933;">=</span> <span style="color: #990000;">eregi_replace</span><span style="color: #009900;">&#40;</span>”<span style="color: #009900;">&#91;</span>\t <span style="color: #009900;">&#93;</span><span style="color: #339933;">+</span>”<span style="color: #339933;">,</span> ” “<span style="color: #339933;">,</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>with these equivalent lines of code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$comment</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span>”<span style="color: #0000ff;">'\n[ \t]+'</span>U”<span style="color: #339933;">,</span> “\n”<span style="color: #339933;">,</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$comment</span> <span style="color: #339933;">=</span> <span style="color: #990000;">str_replace</span><span style="color: #009900;">&#40;</span>”\n”<span style="color: #339933;">,</span> “\\n”<span style="color: #339933;">,</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$comment</span> <span style="color: #339933;">=</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span>”<span style="color: #0000ff;">'[\t ]+'</span>U”<span style="color: #339933;">,</span> ” “<span style="color: #339933;">,</span> <span style="color: #990000;">trim</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Save and close the file, fire up your service browser and you should now be good to go with no more fatal errors in your AMFPHP applications produced by this deprecated function. Happy coding! <img src='http://technophi.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<div style="float: right; padding: 3px;"><a href="http://bufferapp.com/add" class="buffer-add-button" data-text="AMFPHP Fatal Errors After PHP 5.3 Upgrade (Part 2)" data-url="http://technophi.com/2009/10/16/amfphp-fatal-errors-after-php-5-3-upgrade-part-2/" data-via="bufferapp" data-count="none">Buffer</a><script type="text/javascript" src="http://static.bufferapp.com/js/button.js"></script></div><div id="tweetbutton102" class="tw_button" style="padding: 3px;float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fj.mp%2FmdMgjD&amp;via=heroizm&amp;text=AMFPHP%20Fatal%20Errors%20After%20PHP%205.3%20Upgrade%20%28Part%202%29&amp;related=heroizm&amp;lang=en&amp;count=none&amp;counturl=http%3A%2F%2Ftechnophi.com%2F2009%2F10%2F16%2Famfphp-fatal-errors-after-php-5-3-upgrade-part-2%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://technophi.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://technophi.com/2009/10/16/amfphp-fatal-errors-after-php-5-3-upgrade-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AMFPHP Fatal Errors After PHP 5.3 Upgrade (Part 1)</title>
		<link>http://technophi.com/2009/10/14/amfphp-fatal-errors-after-php-5-3-upgrade-part-1/</link>
		<comments>http://technophi.com/2009/10/14/amfphp-fatal-errors-after-php-5-3-upgrade-part-1/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 16:01:57 +0000</pubDate>
		<dc:creator>Hasan Otuome</dc:creator>
				<category><![CDATA[AIR]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[If you experience the following error in your AMFPHP-based applications:

]]></description>
			<content:encoded><![CDATA[<p>If you experience the following error in your AMFPHP-based applications:</p>
<p><em>PHP Fatal error:  Uncaught exception &#8216;VerboseException&#8217; with message &#8216;date(): It is not safe to rely on the system&#8217;s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected &#8216;America/Los_Angeles&#8217; for &#8216;PDT/-7.0/DST&#8217; instead&#8217; in /path/to/amfphp/core/amf/app/Gateway.php:213\nStack trace:\n#0 [internal function]: amfErrorHandler(2, &#8216;date(): It is n&#8230;&#8217;, &#8216;/path/to/amfphp&#8230;&#8217;, 213, Array)\n#1 /path/to/amfphp/core/amf/app/Gateway.php(213): date(&#8216;D, j M Y &#8216;)\n#2 /path/to/amfphp/gateway.php(154): Gateway->service()\n#3 {main}\n  thrown in /path/to/amfphp/core/amf/app/Gateway.php on line 213, referer: http://www.yourdomain.com/path/to/amfphp/browser/servicebrowser.swf</em></p>
<p>You can fix it by uncommenting and defining the [code]date.timezone[/code] line in your php.ini configuration file. For my local environment that would look like the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">date.timezone = <span style="color: #ff0000;">&quot;America/Los Angeles&quot;</span></pre></div></div>

<p>This, unfortunately, is just one of the things that breaks upon upgrading to PHP 5.3. Stay tuned as I try to catalog them along with the fixes&#8230;:)</p>
<div style="float: right; padding: 3px;"><a href="http://bufferapp.com/add" class="buffer-add-button" data-text="AMFPHP Fatal Errors After PHP 5.3 Upgrade (Part 1)" data-url="http://technophi.com/2009/10/14/amfphp-fatal-errors-after-php-5-3-upgrade-part-1/" data-via="bufferapp" data-count="none">Buffer</a><script type="text/javascript" src="http://static.bufferapp.com/js/button.js"></script></div><div id="tweetbutton101" class="tw_button" style="padding: 3px;float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fj.mp%2FiYisfG&amp;via=heroizm&amp;text=AMFPHP%20Fatal%20Errors%20After%20PHP%205.3%20Upgrade%20%28Part%201%29&amp;related=heroizm&amp;lang=en&amp;count=none&amp;counturl=http%3A%2F%2Ftechnophi.com%2F2009%2F10%2F14%2Famfphp-fatal-errors-after-php-5-3-upgrade-part-1%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://technophi.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://technophi.com/2009/10/14/amfphp-fatal-errors-after-php-5-3-upgrade-part-1/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Flex :: AMFPHP Login</title>
		<link>http://technophi.com/2006/07/10/flex-amfphp-login/</link>
		<comments>http://technophi.com/2006/07/10/flex-amfphp-login/#comments</comments>
		<pubDate>Mon, 10 Jul 2006 08:00:00 +0000</pubDate>
		<dc:creator>Hasan Otuome</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[AMFPHP]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[The subject pops up a lot about reusable Flex components. Here's one to handle multi-user logins via AMFPHP / MySQL:

[code lang="Actionscript"]< ?xml version="1.0" encoding="utf-8"?>
<mx :Canvas xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" width="355" height="213">
	</mx><mx :Script>
		< ![CDATA[
			import flash.net.Responder;
			
			public var gateway:RemotingConnection;
			
			public function checkLogin(service:String,params:Array):void{
				gateway = new RemotingConnection("http://yourwebserver.com/flashservices/gateway.php");
]]></description>
			<content:encoded><![CDATA[<p>The subject pops up a lot about reusable Flex components. Here&#8217;s one to handle multi-user logins via AMFPHP / MySQL:</p>

<div class="wp_syntax"><div class="code"><pre class="mxml" style="font-family:monospace;"><span style="color: #000000;">&lt; ?xml version=<span style="color: #ff0000;">&quot;1.0&quot;</span> encoding=<span style="color: #ff0000;">&quot;utf-8&quot;</span>?<span style="color: #7400FF;">&gt;</span></span>
<span style="color: #000000;">&lt;mx :Canvas xmlns:mx=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span> xmlns=<span style="color: #ff0000;">&quot;*&quot;</span> width=<span style="color: #ff0000;">&quot;355&quot;</span> height=<span style="color: #ff0000;">&quot;213&quot;</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;">&lt;/mx<span style="color: #7400FF;">&gt;</span>&lt;mx :Script<span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;">&lt; !<span style="color: #66cc66;">&#91;</span>CDATA<span style="color: #66cc66;">&#91;</span></span>
<span style="color: #000000;">			import flash.net.Responder;</span>
&nbsp;
<span style="color: #000000;">			public var gateway:RemotingConnection;</span>
&nbsp;
<span style="color: #000000;">			public function checkLogin<span style="color: #66cc66;">&#40;</span> service:String, params:Array <span style="color: #66cc66;">&#41;</span>:void</span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">				gateway = new RemotingConnection<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;http://yourwebserver.com/flashservices/gateway.php&quot;</span> <span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">				gateway.call<span style="color: #66cc66;">&#40;</span> service,new Responder<span style="color: #66cc66;">&#40;</span>onResult,onFault<span style="color: #66cc66;">&#41;</span>,params <span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">			public function onResult<span style="color: #66cc66;">&#40;</span> result:Array <span style="color: #66cc66;">&#41;</span>:void</span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">				if <span style="color: #66cc66;">&#40;</span>result<span style="color: #66cc66;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#93;</span>!=<span style="color: #ff0000;">&quot;VALID&quot;</span><span style="color: #66cc66;">&#41;</span></span>
<span style="color: #000000;">				<span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">					lResponse.text = result<span style="color: #66cc66;">&#91;</span> <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">				<span style="color: #66cc66;">&#125;</span> </span>
<span style="color: #000000;">				else </span>
<span style="color: #000000;">				<span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">					lResponse.text = result<span style="color: #66cc66;">&#91;</span> <span style="color: #cc66cc;">1</span> <span style="color: #66cc66;">&#93;</span>;</span>
<span style="color: #000000;">					parentDocument.currentState=<span style="color: #ff0000;">'Main'</span>;</span>
<span style="color: #000000;">				<span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">			public function onFault<span style="color: #66cc66;">&#40;</span> fault:String <span style="color: #66cc66;">&#41;</span>:void</span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">				lResponse.text = <span style="color: #ff0000;">&quot;Service Error: &quot;</span>+fault;</span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#125;</span></span>
&nbsp;
<span style="color: #000000;">			private function checkInput<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>:void</span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">				if <span style="color: #66cc66;">&#40;</span>tUser.text == <span style="color: #ff0000;">&quot;&quot;</span> || tPass.text == <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #66cc66;">&#41;</span></span>
<span style="color: #000000;">				<span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">					lResponse.text = <span style="color: #ff0000;">&quot;Please complete all fields&quot;</span>;</span>
<span style="color: #000000;">				<span style="color: #66cc66;">&#125;</span> </span>
<span style="color: #000000;">				else </span>
<span style="color: #000000;">				<span style="color: #66cc66;">&#123;</span></span>
<span style="color: #000000;">					lResponse.text = <span style="color: #ff0000;">&quot;Logging in...&quot;</span>;</span>
<span style="color: #000000;">					checkLogin<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">&quot;login.Verify.validate&quot;</span>,<span style="color: #66cc66;">&#91;</span>tUser.text,tPass.text<span style="color: #66cc66;">&#93;</span> <span style="color: #66cc66;">&#41;</span>;</span>
<span style="color: #000000;">				<span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">			<span style="color: #66cc66;">&#125;</span></span>
<span style="color: #000000;">		<span style="color: #66cc66;">&#93;</span><span style="color: #66cc66;">&#93;</span><span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;">&lt;/mx<span style="color: #7400FF;">&gt;</span></span>
	<span style="color: #000000;">&lt;mx : Panel height=<span style="color: #ff0000;">&quot;200&quot;</span> layout=<span style="color: #ff0000;">&quot;absolute&quot;</span> title=<span style="color: #ff0000;">&quot;Admin Login&quot;</span> left=<span style="color: #ff0000;">&quot;0&quot;</span> right=<span style="color: #ff0000;">&quot;5&quot;</span> bottom=<span style="color: #ff0000;">&quot;13&quot;</span><span style="color: #7400FF;">&gt;</span></span>
		<span style="color: #000000;">&lt;mx :Label x=<span style="color: #ff0000;">&quot;33&quot;</span> y=<span style="color: #ff0000;">&quot;45&quot;</span> text=<span style="color: #ff0000;">&quot;Username:&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;">&lt;mx :Label x=<span style="color: #ff0000;">&quot;33&quot;</span> y=<span style="color: #ff0000;">&quot;85&quot;</span> text=<span style="color: #ff0000;">&quot;Password:&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;">&lt;mx :Button x=<span style="color: #ff0000;">&quot;178&quot;</span> y=<span style="color: #ff0000;">&quot;118&quot;</span> label=<span style="color: #ff0000;">&quot;Login&quot;</span> id=<span style="color: #ff0000;">&quot;bLogin&quot;</span> tabIndex=<span style="color: #ff0000;">&quot;3&quot;</span> click=<span style="color: #ff0000;">&quot;checkInput()&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;">&lt;mx :TextInput x=<span style="color: #ff0000;">&quot;113&quot;</span> y=<span style="color: #ff0000;">&quot;83&quot;</span> id=<span style="color: #ff0000;">&quot;tPass&quot;</span> tabIndex=<span style="color: #ff0000;">&quot;2&quot;</span> displayAsPassword=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;">&lt;mx :TextInput x=<span style="color: #ff0000;">&quot;113&quot;</span> y=<span style="color: #ff0000;">&quot;43&quot;</span> id=<span style="color: #ff0000;">&quot;tUser&quot;</span> tabIndex=<span style="color: #ff0000;">&quot;1&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
		<span style="color: #000000;">&lt;mx :Label x=<span style="color: #ff0000;">&quot;113&quot;</span> y=<span style="color: #ff0000;">&quot;10&quot;</span> id=<span style="color: #ff0000;">&quot;lResponse&quot;</span><span style="color: #7400FF;">/&gt;</span></span>
	<span style="color: #000000;">&lt;/mx<span style="color: #7400FF;">&gt;</span></span></pre></div></div>

<p>And here&#8217;s the AMFPHP service that the component connects to:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
<span style="color: #000000; font-weight: bold;">class</span> Verify 
<span style="color: #009900;">&#123;</span>	
	<span style="color: #000000; font-weight: bold;">function</span> Verify<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">methodTable</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
			<span style="color: #0000ff;">&quot;validate&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
				<span style="color: #0000ff;">&quot;access&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;remote&quot;</span><span style="color: #339933;">,</span>
				<span style="color: #0000ff;">&quot;description&quot;</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">&quot;Return the login results&quot;</span>
			<span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> validate<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$nfo</span> <span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$dbc</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_connect</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;localhost&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;username&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">&quot;password&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #990000;">mysql_select_db</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;yourdatabase&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$nfo</span><span style="color: #009900;">&#91;</span> <span style="color: #cc66cc;">0</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$pass</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$nfo</span><span style="color: #009900;">&#91;</span> <span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT DISTINCT * FROM admin WHERE aname = '<span style="color: #006699; font-weight: bold;">$user</span>' AND acode = '<span style="color: #006699; font-weight: bold;">$pass</span>'&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$rs</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_query</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$query</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$var</span> <span style="color: #339933;">=</span> <span style="color: #990000;">mysql_fetch_assoc</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$rs</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$u</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span> <span style="color: #0000ff;">&quot;aname&quot;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$p</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$var</span><span style="color: #009900;">&#91;</span> <span style="color: #0000ff;">&quot;acode&quot;</span> <span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$pass</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$p</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$response</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;INVALID&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$response</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Invalid username and/or password&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> 
		<span style="color: #b1b100;">else</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$response</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;VALID&quot;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$response</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;Welcome <span style="color: #006699; font-weight: bold;">$u</span>&quot;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$response</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Download a ZIP with all the necessary files <a href="http://thesourcecode.org/flex/login/login.zip">here</a>.</p>
<div style="float: right; padding: 3px;"><a href="http://bufferapp.com/add" class="buffer-add-button" data-text="Flex :: AMFPHP Login" data-url="http://technophi.com/2006/07/10/flex-amfphp-login/" data-via="bufferapp" data-count="none">Buffer</a><script type="text/javascript" src="http://static.bufferapp.com/js/button.js"></script></div><div id="tweetbutton70" class="tw_button" style="padding: 3px;float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fj.mp%2Fj057Cb&amp;via=heroizm&amp;text=Flex%20%3A%3A%20AMFPHP%20Login&amp;related=heroizm&amp;lang=en&amp;count=none&amp;counturl=http%3A%2F%2Ftechnophi.com%2F2006%2F07%2F10%2Fflex-amfphp-login%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://technophi.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://technophi.com/2006/07/10/flex-amfphp-login/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Guestbook Reloaded and Revolutions</title>
		<link>http://technophi.com/2006/04/10/guestbook-reloaded-and-revolutions/</link>
		<comments>http://technophi.com/2006/04/10/guestbook-reloaded-and-revolutions/#comments</comments>
		<pubDate>Tue, 11 Apr 2006 03:33:34 +0000</pubDate>
		<dc:creator>Hasan Otuome</dc:creator>
				<category><![CDATA[Adobe]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Some folks were still in need after viewing Flash Guestbook Basics so I've added (2) more videos. Part 2 covers building the PHP script that handles the Flash to MySQL communication while Part 3 deals solely with getting the MySQL database setup. Hopefully this will ease some of their tensions.]]></description>
			<content:encoded><![CDATA[<p>Some folks were still in need after viewing Flash Guestbook Basics so I&#8217;ve added (2) more videos. Part 2 covers building the PHP script that handles the Flash to MySQL communication while Part 3 deals solely with getting the MySQL database setup. Hopefully this will ease some of their tensions.</p>
<div style="float: right; padding: 3px;"><a href="http://bufferapp.com/add" class="buffer-add-button" data-text="Guestbook Reloaded and Revolutions" data-url="http://technophi.com/2006/04/10/guestbook-reloaded-and-revolutions/" data-via="bufferapp" data-count="none">Buffer</a><script type="text/javascript" src="http://static.bufferapp.com/js/button.js"></script></div><div id="tweetbutton3" class="tw_button" style="padding: 3px;float:right;margin-left:10px;"><a href="http://twitter.com/share?url=http%3A%2F%2Fj.mp%2Fmksg7l&amp;via=heroizm&amp;text=Guestbook%20Reloaded%20and%20Revolutions&amp;related=heroizm&amp;lang=en&amp;count=none&amp;counturl=http%3A%2F%2Ftechnophi.com%2F2006%2F04%2F10%2Fguestbook-reloaded-and-revolutions%2F" class="twitter-share-button"  style="width:55px;height:22px;background:transparent url('http://technophi.com/wp-content/plugins/wp-tweet-button/tweetn.png') no-repeat  0 0;text-align:left;text-indent:-9999px;display:block;">Tweet</a></div>]]></content:encoded>
			<wfw:commentRss>http://technophi.com/2006/04/10/guestbook-reloaded-and-revolutions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

