<?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>[SMD] - 8L0G5PH3R3 &#187; PHP Programming</title>
	<atom:link href="http://www.sumardi.net/category/web-development/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sumardi.net</link>
	<description>/home/smd/public_html/blog</description>
	<lastBuildDate>Mon, 06 Feb 2012 13:30:05 +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>Installing OAuth extension in XAMPP for Mac OS X</title>
		<link>http://www.sumardi.net/2011/06/04/installing-oauth-extension-in-xampp-for-mac-os-x/</link>
		<comments>http://www.sumardi.net/2011/06/04/installing-oauth-extension-in-xampp-for-mac-os-x/#comments</comments>
		<pubDate>Fri, 03 Jun 2011 22:42:48 +0000</pubDate>
		<dc:creator>SMD</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP Programming]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.sumardi.net/?p=675</guid>
		<description><![CDATA[Installing via PECL didn&#8217;t really work out for me. So, here is what I did: Install Xcode if you don&#8217;t have it Download &#038; install XAMPP for Mac developer package You will need the PHP header files. Create a symlink: ln -s /Applications/XAMPP/xamppfiles/lib /Applications/XAMPP/xamppfiles/include Download the module here: http://pecl.php.net/get/oauth Unpack Run phpize: sudo /Applications/XAMPP/xamppfiles/bin/phpize Configure [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.sumardi.net%2F2011%2F06%2F04%2Finstalling-oauth-extension-in-xampp-for-mac-os-x%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.sumardi.net%2F2011%2F06%2F04%2Finstalling-oauth-extension-in-xampp-for-mac-os-x%2F&amp;source=sumardi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Installing via PECL didn&#8217;t really work out for me. So, here is what I did:</p>
<ul>
<li>Install <a href="http://developer.apple.com/xcode">Xcode</a> if you don&#8217;t have it</li>
<p>	</p>
<li>Download  &#038; install <a href="http://www.apachefriends.org/en/xampp-macosx.html">XAMPP for Mac developer package</a></li>
<p>	</p>
<li>You will need the PHP header files. Create a symlink: <br /><strong><code>ln -s /Applications/XAMPP/xamppfiles/lib /Applications/XAMPP/xamppfiles/include</code></strong></li>
<p>	</p>
<li>Download the module here: <a href="http://pecl.php.net/get/oauth">http://pecl.php.net/get/oauth</a></li>
<p>		      </p>
<li>Unpack</li>
<p>	</p>
<li>Run phpize: <br /><strong><code>sudo /Applications/XAMPP/xamppfiles/bin/phpize</code></strong></li>
<p>	</p>
<li>Configure with the following command:<br /><strong><code>sudo MACOSX_DEPLOYMENT_TARGET=10.6 CFLAGS='-O3 -fno-common -arch i386 -arch x86_64' LDFLAGS='-O3 -arch i386 -arch x86_64' CXXFLAGS='-O3 -fno-common -arch i386 -arch x86_64' ./configure --with-php-config=/Applications/XAMPP/xamppfiles/bin/php-config</code></strong></li>
<p>	</p>
<li>Run <strong><code>sudo make</code></strong></li>
<p>	</p>
<li>Copy the module to your extension directory<br /><strong><code>sudo cp modules/oauth.so /Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626/</code></strong></li>
<p>	</p>
<li>Enable the module by adding this to your php.ini:<br /><strong><code>extension=oauth.so</code></strong></li>
<p>	</p>
<li>Restart apache and run <code>phpinfo()</code> to see if it&#8217;s working</li>
<p>	</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumardi.net/2011/06/04/installing-oauth-extension-in-xampp-for-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>OSX : Installing MongoDB and the PHP MongoDB driver.</title>
		<link>http://www.sumardi.net/2011/01/07/installing-mongodb-and-the-php-mongodb-driver/</link>
		<comments>http://www.sumardi.net/2011/01/07/installing-mongodb-and-the-php-mongodb-driver/#comments</comments>
		<pubDate>Fri, 07 Jan 2011 09:30:16 +0000</pubDate>
		<dc:creator>SMD</dc:creator>
				<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP Programming]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[mongo]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xampp]]></category>

		<guid isPermaLink="false">http://www.sumardi.net/?p=649</guid>
		<description><![CDATA[1) Grab the latest 64-bit version for OSX from MongoDB website. 2) Untar the file tar -zxvf mongodb-osx-x86_64-1.6.5.tgz 3) I use XAMPP for OS X, need to create a location for it to store databases. sudo mkdir -p /Applications/XAMPP/xamppfiles/var/mongodb sudo cp -r bin/* /Applications/XAMPP/xamppfiles/bin/ 4) Create configuration file, name it mongodb.conf and put it at [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.sumardi.net%2F2011%2F01%2F07%2Finstalling-mongodb-and-the-php-mongodb-driver%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.sumardi.net%2F2011%2F01%2F07%2Finstalling-mongodb-and-the-php-mongodb-driver%2F&amp;source=sumardi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>1) Grab the latest 64-bit version for OSX from <a href="http://www.mongodb.org/downloads">MongoDB</a> website.</p>
<p>2) Untar the file<br />
<code>tar -zxvf mongodb-osx-x86_64-1.6.5.tgz</code></p>
<p>3) I use <a href="http://www.apachefriends.org/en/xampp-macosx.html">XAMPP for OS X</a>, need to create a location for it to store databases.<br />
<code>sudo mkdir -p /Applications/XAMPP/xamppfiles/var/mongodb</code><br />
<code>sudo cp -r bin/* /Applications/XAMPP/xamppfiles/bin/</code></p>
<p>4) Create configuration file, name it mongodb.conf and put it at /Applications/XAMPP/xamppfiles/var/mongodb.<br />
<code><br />
# Store data alongside MongoDB instead of the default, /data/db/<br />
dbpath = /Applications/XAMPP/xamppfiles/var/mongodb</p>
<p># Only accept local connections<br />
bind_ip = 127.0.0.1<br />
</code></p>
<p>5) Run MongoDB deamon with this command<br />
<code>sudo /Applications/XAMPP/xamppfiles/bin/mongod --config=/Applications/XAMPP/xamppfiles/var/mongodb/mongodb.conf</code></p>
<p>6) Test if it&#8217;s running http://localhost:28017.</p>
<p>7) To install Mongo PHP driver, compile the driver from the latest source on <a href="https://github.com/mongodb/mongo-php-driver">GitHub</a>.<br />
<code><br />
tar zxvf mongodb-mongodb-php-driver-<commit_id>.tar.gz<br />
cd mongodb-mongodb-php-driver-<commit_id><br />
sudo /Applications/XAMPP/xamppfiles/bin/phpize<br />
./configure<br />
sudo make install<br />
</code></p>
<p>8 ) Copy compiled module to PHP extension directory.<br />
<code><br />
/Applications/XAMPP/xamppfiles/bin/php -i | grep extension_dir<br />
cp modules/mongo.so /Applications/XAMPP/xamppfiles/lib/php/php-5.3.1/extensions/no-debug-non-zts-20090626<br />
</code></p>
<p>9) Load the extension on PHP startup, add a line to php.ini:<br />
<code>extension=mongo.so</code></p>
<p>10) And you are good to start Mongo! Cheers.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumardi.net/2011/01/07/installing-mongodb-and-the-php-mongodb-driver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Security Talk at MyGOSSCON 2010</title>
		<link>http://www.sumardi.net/2010/11/11/php-security-talk-at-mygosscon-2010/</link>
		<comments>http://www.sumardi.net/2010/11/11/php-security-talk-at-mygosscon-2010/#comments</comments>
		<pubDate>Wed, 10 Nov 2010 19:59:20 +0000</pubDate>
		<dc:creator>SMD</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP Programming]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.sumardi.net/?p=644</guid>
		<description><![CDATA[Slide from my recent presentation at MyGOSSCON 2010 PHP Security View more presentations from Sumardi Shukor. A big thank you to those who attended my presentation. Big applause to the organizer.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.sumardi.net%2F2010%2F11%2F11%2Fphp-security-talk-at-mygosscon-2010%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.sumardi.net%2F2010%2F11%2F11%2Fphp-security-talk-at-mygosscon-2010%2F&amp;source=sumardi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Slide from my recent presentation at MyGOSSCON 2010</p>
<div style="width:425px" id="__ss_5661948"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/sumardi1/php-security-5661948" title="PHP Security">PHP Security</a></strong><object id="__sse5661948" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=php03security-101103220229-phpapp01&#038;stripped_title=php-security-5661948&#038;userName=sumardi1" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed name="__sse5661948" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=php03security-101103220229-phpapp01&#038;stripped_title=php-security-5661948&#038;userName=sumardi1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/sumardi1">Sumardi Shukor</a>.</div>
</div>
<p>A big thank you to those who attended my presentation. Big applause to the organizer. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumardi.net/2010/11/11/php-security-talk-at-mygosscon-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sayonara PHP4?</title>
		<link>http://www.sumardi.net/2007/07/07/sayonara-php4/</link>
		<comments>http://www.sumardi.net/2007/07/07/sayonara-php4/#comments</comments>
		<pubDate>Sat, 07 Jul 2007 08:46:50 +0000</pubDate>
		<dc:creator>SMD</dc:creator>
				<category><![CDATA[PHP Programming]]></category>

		<guid isPermaLink="false">http://www.sumardi.net/2007/07/07/sayonara-php4/</guid>
		<description><![CDATA[As a PHP Developer, I think it&#8217;s time to move forward to PHP5. Today, I checked GoPHP5.org initiative: PHP developers cannot leverage PHP 5&#8242;s full potential without dropping support for PHP 4, but PHP 4 is still installed on a majority of shared web hosts and users would then be forced to switch to a [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.sumardi.net%2F2007%2F07%2F07%2Fsayonara-php4%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.sumardi.net%2F2007%2F07%2F07%2Fsayonara-php4%2F&amp;source=sumardi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>As a PHP Developer, I think it&#8217;s time to move forward to PHP5. </p>
<p>Today, I checked <a href="http://gophp5.org">GoPHP5.org</a> initiative:</p>
<blockquote><p>PHP developers cannot leverage PHP 5&#8242;s full potential without dropping support for PHP 4, but PHP 4 is still installed on a majority of shared web hosts and users would then be forced to switch to a different application. Web hosts cannot upgrade their servers to PHP 5 without making it impossible for their users to run PHP 4-targeted web apps, and have no incentive to go to the effort of testing and deploying PHP 5 while most web apps are still compatible with PHP 4 and the PHP development team still provides maintenance support for PHP 4. The PHP development team, of course, can&#8217;t drop maintenance support for PHP 4 while most web hosts still run PHP 4.</p>
<p>It is a dangerous cycle, and one that needs to be broken. The PHP developer community has decided that it is indeed now time to move forward, together. Therefore, the listed software projects have all agreed that effective February 5th, 2008, any new feature releases will have a minimum version requirement of at least PHP 5.2.0. Furthermore, the listed web hosts have agreed that effective February 5th, 2008, they will include PHP 5.2 (or a more recent version) in their service offer.</p>
<p>It is our belief that this will provide web hosts reason to upgrade and the PHP development team the ability to retire PHP 4 and focus efforts on PHP 5 and the forthcoming PHP 6, all without penalizing any existing project for being &#8220;first out of the gate&#8221;.</p></blockquote>
<p>There&#8217;re some of the big open source projects such as Drupal, PHPMyAdmin and MediaWiki support this initiative. They throw out PHP4 supports for the latest release of their project.</p>
<p>So, the time has come. We have to move forward to PHP5. Lets focus our efforts to PHP5 and forthcoming PHP6! Go PHP5!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumardi.net/2007/07/07/sayonara-php4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL Case Sensitive On Linux</title>
		<link>http://www.sumardi.net/2007/07/05/mysql-case-sensitive-on-linux/</link>
		<comments>http://www.sumardi.net/2007/07/05/mysql-case-sensitive-on-linux/#comments</comments>
		<pubDate>Wed, 04 Jul 2007 16:45:14 +0000</pubDate>
		<dc:creator>SMD</dc:creator>
				<category><![CDATA[PHP Programming]]></category>

		<guid isPermaLink="false">http://www.sumardi.net/2007/07/05/mysql-case-sensitive-on-linux/</guid>
		<description><![CDATA[A good rule to remember. MySQL are case sensitive only table and database identifiers and only on platforms with case-sensitive filenames (Linux/Unix). So, If you&#8217;re developing a system. Do remember. MySQL are case sensitive. An example: Bad Practice: select * from Project Good Practice: SELECT * FROM project Ref: Identifier Case Sensitive]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.sumardi.net%2F2007%2F07%2F05%2Fmysql-case-sensitive-on-linux%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.sumardi.net%2F2007%2F07%2F05%2Fmysql-case-sensitive-on-linux%2F&amp;source=sumardi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>A good rule to remember. MySQL are case sensitive only table and database identifiers and only on platforms with case-sensitive filenames (Linux/Unix). So, If you&#8217;re developing a system. Do remember. MySQL are case sensitive. An example:</p>
<p>Bad Practice:<br />
<code>select * from Project</code></p>
<p>Good Practice:<br />
<code>SELECT * FROM project</code></p>
<p>Ref: <a href="http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html">Identifier Case Sensitive</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumardi.net/2007/07/05/mysql-case-sensitive-on-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Inspekt Build Available</title>
		<link>http://www.sumardi.net/2007/06/07/inspekt-build-available/</link>
		<comments>http://www.sumardi.net/2007/06/07/inspekt-build-available/#comments</comments>
		<pubDate>Thu, 07 Jun 2007 05:37:55 +0000</pubDate>
		<dc:creator>SMD</dc:creator>
				<category><![CDATA[PHP Programming]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://www.sumardi.net/2007/06/07/inspekt-build-available/</guid>
		<description><![CDATA[Yesteday, I presented a full-day tutorial on SQL Injection &#038; Session Hijacking In PHP Programming which seems to have been well received by those who attended. And today, I would like to present to you a new Inspekt Build available to be downloaded at Google Code. What is Inspekt? Inspekt acts as a sort of [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.sumardi.net%2F2007%2F06%2F07%2Finspekt-build-available%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.sumardi.net%2F2007%2F06%2F07%2Finspekt-build-available%2F&amp;source=sumardi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Yesteday, I presented a full-day tutorial on <em>SQL Injection &#038; Session Hijacking In PHP Programming</em> which seems to have been well received by those who attended. And today, I would like to present to you a new Inspekt Build available to be downloaded at <a href="http://code.google.com/p/inspekt">Google Code</a>.</p>
<p><strong>What is Inspekt?</strong></p>
<p>Inspekt acts as a sort of &#8216;firewall&#8217; API between user input and the rest of the application. It takes PHP superglobal arrays, encapsulates their data in an &#8220;cage&#8221; object, and destroys the original superglobal. Data can then be retrieved from the input data object using a variety of accessor methods that apply filtering, or the data can be checked against validation methods. Raw data can only be accessed via a &#8216;getRaw()&#8217; method, forcing the developer to show clear intent.<br />
- From Inspekt</p>
<p>It supports PHP4 &#038; PHP5. More info at <a href="http://code.google.com/p/inspekt/">http://code.google.com/p/inspekt/</a></p>
<p>- <a href="http://code.google.com/p/inspekt/wiki/BasicUsage">Sample Basic Usage</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumardi.net/2007/06/07/inspekt-build-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Loves JSON</title>
		<link>http://www.sumardi.net/2007/05/19/php-loves-json/</link>
		<comments>http://www.sumardi.net/2007/05/19/php-loves-json/#comments</comments>
		<pubDate>Fri, 18 May 2007 18:31:51 +0000</pubDate>
		<dc:creator>SMD</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[PHP Programming]]></category>

		<guid isPermaLink="false">http://www.sumardi.net/2007/05/19/php-loves-json/</guid>
		<description><![CDATA[JSON is a format for communication between the server-side (PHP, JSP, ASP, etc&#8230;) and the client-side (javascript). The magic of it is that the response from the server-side can be easily converted to an object via the use of the eval() function. eval() (can be &#8220;evil&#8221;) is a function that gives you the possibility to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.sumardi.net%2F2007%2F05%2F19%2Fphp-loves-json%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.sumardi.net%2F2007%2F05%2F19%2Fphp-loves-json%2F&amp;source=sumardi&amp;style=normal&amp;service=bit.ly&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>JSON is a format for communication between the server-side (PHP, JSP, ASP, etc&#8230;) and the client-side (javascript). The magic of it is that the response from the server-side can be easily converted to an object via the use of the <code>eval()</code> function. <code>eval()</code> (can be &#8220;evil&#8221;) is a function that gives you the possibility to execute some code in javascript from a string. To use <code>eval()</code> is not a good idea. </p>
<p><strong>How can you JSON from PHP?</strong></p>
<p>If you are using PHP 5.2.x and above, you can simply use PHP built-in function, <code>json_encode()</code> and <code>json_decode().</code> This is an example how it works:</p>
<p>$i = array(<br />
                 array(&#8220;id&#8221; => 1, &#8220;name&#8221; => &#8220;sumardi&#8221;),<br />
                 array(&#8220;id&#8221; => 2, &#8220;name&#8221; => &#8220;hassan&#8221;),<br />
                 array(&#8220;id&#8221; => 3, &#8220;name&#8221; => &#8220;ruby&#8221;)<br />
        );</p>
<p>echo json_encode($i);</p>
<p>And it will echo :</p>
<p><code>[{"id":1,"name":"sumardi"},{"id":2,"name":"hassan"},{"id":3,"name":"ruby"}]</code></p>
<p><strong>How to JSON on Client-Side?</strong></p>
<p>Use the <code>eval()</code> function on the Server-Side JSON text response. And then you can call JSON like this:</p>
<p>for(var i = 0; i < json.length; i++)<br />
{<br />
    console.info(json.id + &#8221; &#8221; + json.name);<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sumardi.net/2007/05/19/php-loves-json/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

