<?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>Andy&#039;s Web</title>
	<atom:link href="http://andyph.info/feed/" rel="self" type="application/rss+xml" />
	<link>http://andyph.info</link>
	<description>Building Your Dreams Into Reality</description>
	<lastBuildDate>Mon, 28 Nov 2011 16:10:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Mike Bashi</title>
		<link>http://andyph.info/portfolio/wordpress-development/2011/mike-bashi/</link>
		<comments>http://andyph.info/portfolio/wordpress-development/2011/mike-bashi/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 16:10:40 +0000</pubDate>
		<dc:creator>Andy Christian Loyola</dc:creator>
				<category><![CDATA[Wordpress Development]]></category>

		<guid isPermaLink="false">http://andyph.info/?p=314</guid>
		<description><![CDATA[Project Type: WordPress Development Description: Add additional feature to the existing theme. Modified the plugin to display slider images]]></description>
			<content:encoded><![CDATA[<p><a href="http://andyph.info/wp-content/uploads/2011/11/mikebashi.com_.png"><img class="alignleft size-medium wp-image-316" title="mikebashi.com" src="http://andyph.info/wp-content/uploads/2011/11/mikebashi.com_-300x152.png" alt="" width="300" height="152" /></a>Project Type: WordPress Development</p>
<p>Description: Add additional feature to the existing theme. Modified the plugin to display slider images.</p>
<p><a class="bigbutton" href="http://mikebashi.com/">Visit the site</a></p>
]]></content:encoded>
			<wfw:commentRss>http://andyph.info/portfolio/wordpress-development/2011/mike-bashi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Central Florida Real Estate For Sale</title>
		<link>http://andyph.info/portfolio/wordpress-development/2011/central-florida-real-estate-for-sale/</link>
		<comments>http://andyph.info/portfolio/wordpress-development/2011/central-florida-real-estate-for-sale/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 16:07:03 +0000</pubDate>
		<dc:creator>Andy Christian Loyola</dc:creator>
				<category><![CDATA[Wordpress Development]]></category>

		<guid isPermaLink="false">http://andyph.info/?p=311</guid>
		<description><![CDATA[Project Type: WordPress Development Description: Install wordpress, create and design the whole theme]]></description>
			<content:encoded><![CDATA[<p><a href="http://andyph.info/wp-content/uploads/2011/11/centralfloridarealestateforsale.net_.png"><img class="alignleft size-medium wp-image-312" title="centralfloridarealestateforsale.net" src="http://andyph.info/wp-content/uploads/2011/11/centralfloridarealestateforsale.net_-300x147.png" alt="" width="300" height="147" /></a> Project Type: WordPress Development</p>
<p>Description: Install wordpress, create and design the whole theme.</p>
<p><a class="bigbutton" href="http://centralfloridarealestateforsale.net/">Visit the site</a></p>
]]></content:encoded>
			<wfw:commentRss>http://andyph.info/portfolio/wordpress-development/2011/central-florida-real-estate-for-sale/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Devel Using .append() and .empty()</title>
		<link>http://andyph.info/blog/2011/jquery-devel-using-append-and-empty/</link>
		<comments>http://andyph.info/blog/2011/jquery-devel-using-append-and-empty/#comments</comments>
		<pubDate>Mon, 28 Feb 2011 05:32:48 +0000</pubDate>
		<dc:creator>Andy Christian Loyola</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[.append()]]></category>
		<category><![CDATA[.empty()]]></category>
		<category><![CDATA[Custom Wordpress Development]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Wordpress Plugin Development]]></category>

		<guid isPermaLink="false">http://andyph.info/?p=299</guid>
		<description><![CDATA[What? I&#8217;m currently in the middle of my wordpress plugin development and I encountered a problem in using .append(). The problem is that whenever I ]]></description>
			<content:encoded><![CDATA[<h2>What?</h2>
<p>I&#8217;m currently in the middle of my wordpress plugin development and I encountered a problem in using .append(). The problem is that whenever I called the .append() many times without refreshing the page cause the message to duplicate itself.</p>
<h2>Solution</h2>
<p>Gladly, there&#8217;s the .empty() to support the process and solve my problem.</p>
<p>This original code, if you put this to a click even wherein you will have to click on something, this will cause the .append msg to appear many times.</p>
<p>[php]</p>
<p>jQuery(function($) {<br />
var msg = &#8216;Hello World&#8217;;<br />
$(&#8216;.msg&#8217;).append(msg);<br />
});<br />
[/php]</p>
<p>This is the solution to this&#8230;.</p>
<p>[php]</p>
<p>jQuery(function($) {<br />
var msg = &#8216;Hello World&#8217;;<br />
$(&#8216;.msg&#8217;).empty(); // empty first<br />
$(&#8216;.msg&#8217;).append(msg); // then call out the .append();<br />
});<br />
[/php]</p>
<h2>Conclusion</h2>
<p><a href="http://jquery.com/">jQuery </a>really became much popular than <a href="http://mootools.net/">mootools </a>and <a href="http://script.aculo.us/">scriptaculous </a>in general have a flexible solution to almost everything. But every ups has its own downs. But for now, I&#8217;m consistent in using jQuery in my development.</p>
<p>Happy coding. <img src='http://andyph.info/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://andyph.info/blog/2011/jquery-devel-using-append-and-empty/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Block Online Advertisements</title>
		<link>http://andyph.info/blog/2011/block-online-advertisements/</link>
		<comments>http://andyph.info/blog/2011/block-online-advertisements/#comments</comments>
		<pubDate>Wed, 23 Feb 2011 21:36:30 +0000</pubDate>
		<dc:creator>Andy Christian Loyola</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Ad Blocker]]></category>
		<category><![CDATA[Advertisement]]></category>

		<guid isPermaLink="false">http://andyph.info/?p=292</guid>
		<description><![CDATA[What? While a good majority of the users enjoyed the article, the experience for some was reduced by an intersitual ad. I don&#8217;t rely on ]]></description>
			<content:encoded><![CDATA[<h2>What?</h2>
<p>While a good majority of the users enjoyed the article, the experience  for some was reduced by an intersitual ad. I don&#8217;t rely on advertising  to put food on my table, it&#8217;s just nice to have that money coming in  every month. I feel the four second ad is fair for the free content  accessible on every page here, and barring any issues with the browser,  only displays once every six hours.</p>
<p>However, the main intention of many pages here is to help the user  improve their computing experience. With that in mind, here are a couple  methods of blocking the advertisements around the Internet.</p>
<h2>Solutions</h2>
<h3>Firefox &#8211; Adblock Plus</h3>
<blockquote><p>Adblock Plus is generally the most recommended method online, so I&#8217;ll go over that one first. If you are using the <a href="http://getfirefox.com/">Firefox</a> browser, you may have already heard of this very <a href="https://addons.mozilla.org/en-US/firefox/addon/1865">popular extension</a>.</p>
<p>A huge advantage of Adblock Plus is the subscription feature. A  precompiled list of most advertising sites is included in that list, and  will automatically block them for you if you wish.</p></blockquote>
<h3>Opera &#8211; Content Blocker</h3>
<blockquote><p><a href="http://www.opera.com/">Opera</a> belongs in this article as  well, as they actually have an ad blocker built-in to their broswer. The  usage is as simple as right-clicking an empty spot on the page and  selecting <em>Block Content&#8230;</em> Once you select that, a notice will  come up asking you what content you wish to block. Click the ad or  element you need blocked and it is done. You can read more info about it  at the <a href="http://operawiki.info/OperaAdblock">Opera Wiki</a>.</p></blockquote>
<h3>Alternatives</h3>
<div>
<blockquote><p>If you would rather block the ad servers systemwide, you may want to  look into blocking based on your hosts file. On Windows it is generally  located in C:\Windows\system32\drivers\etc\ and uses the file called  hosts. Linux and Mac users will find their hosts file in the /etc  directory. A <a href="http://www.mvps.org/winhelp2002/hosts.txt">precompiled hosts list</a> can be found here, and will work on any system.</p>
<p>While you&#8217;re editing your hosts file, why don&#8217;t you block that shock  site your friend is constantly tinyurl&#8217;ing you to. Adding the line</p>
<p>[php]127.0.0.1 evilsite.com[/php] and replacing evilsite.com with the bad site you don&#8217;t want to see  anymore will make sure that site doesn&#8217;t load for you anymore. I would  suggest testing this with a more mild site, just in case your first  attempt isn&#8217;t that successful and you accidentally visit the bad site.</p></blockquote>
<h2>Conclusion</h2>
<p>I hope I&#8217;ve improved the Internet usage for anyone reading this article.  If you have any suggestions, feel free to fire away in the comments  section below.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://andyph.info/blog/2011/block-online-advertisements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add Parameters To Your PHP Class</title>
		<link>http://andyph.info/blog/2011/add-parameters-to-your-php-class/</link>
		<comments>http://andyph.info/blog/2011/add-parameters-to-your-php-class/#comments</comments>
		<pubDate>Wed, 16 Feb 2011 15:05:48 +0000</pubDate>
		<dc:creator>Andy Christian Loyola</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP Class]]></category>

		<guid isPermaLink="false">http://andyph.info/?p=284</guid>
		<description><![CDATA[What? The other day, I received an email asking me on how to add parameters in PHP Class. I've implemented this kind of stuff not ]]></description>
			<content:encoded><![CDATA[
<h2>What?</h2>
The other day, I received an email asking me on how to add parameters in PHP Class. I've implemented this kind of stuff not only once but many times already to my projects, thus I ended up writing this simple tutorial on adding parameters to your PHP Class.

<strong>Constructors</strong> define how your class is created and can also have parameters. In essence, they make your classes modifiable. Constructors can be used for a variety of reasons. In my case (codes will be provided below), I needed to connect to a database. Instead of using a function and a class, I combined my function into a constructor. For this reason, I will show you how to use a class to connect to a database as an example.
<h2>Solutions</h2>
<ul>
	<li>
<h4>Create the __construct() function in your PHP Class</h4>
</li>
</ul>
[php]
class samplePHPClass {
function __construct() {

}
}
[/php]
<ul>
	<li>
<h4>Add Parameters to the __construct() function</h4>
</li>
</ul>
[php]
function __construct($db_host, $db_user, $db_pass, $db_name) { }
[/php]
<ul>
	<li>
<h4>Make your function</h4>
</li>
</ul>
[php]
function __construct($db_host, $db_user, $db_pass, $db_name) {
global $db_prefix;
$link = mysql_connect($db_host, $db_user, $db_pass);
$db = mysql_select_db($db_name);
$this-&gt;prefix = $db_prefix;
return $link;
}
[/php]
<ul>
	<li>
<h4>Add support for PHP 4</h4>
</li>
</ul>
[php]
function samplePHPClass() {
$this-&gt;__construct();
}
[/php]
<ul>
	<li>
<h4>Final Code - finish product</h4>
</li>
</ul>
[php]
class samplePHPClass {
function samplePHPClass() {
$this-&gt;__construct();
}

function __construct($db_host, $db_user, $db_pass, $db_name) {
global $db_prefix;
$link = mysql_connect($db_host, $db_user, $db_pass);
$db = mysql_select_db($db_name);
$this-&gt;prefix = $db_prefix;
return $link;
}
}
[/php]

To use it, follow the code below:
[php]
$sampleConnect = new samplePHPClass("localhost", "myUser", "myPass", "myDb");
[/php]
]]></content:encoded>
			<wfw:commentRss>http://andyph.info/blog/2011/add-parameters-to-your-php-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Love is in The Air &#8211; Valentine&#8217;s Day</title>
		<link>http://andyph.info/blog/2011/love-is-in-the-air-valentines-day/</link>
		<comments>http://andyph.info/blog/2011/love-is-in-the-air-valentines-day/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 15:28:24 +0000</pubDate>
		<dc:creator>Andy Christian Loyola</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Love]]></category>
		<category><![CDATA[Love Month]]></category>
		<category><![CDATA[Valentine's Day]]></category>

		<guid isPermaLink="false">http://andyph.info/?p=264</guid>
		<description><![CDATA[What? Quit for now with blogging on web development and other good stuff and let's talk about Love. Yes, you read it right. Today, we're ]]></description>
			<content:encoded><![CDATA[
<h2>What?</h2>
Quit for now with blogging on web development and other good stuff and let's talk about Love. Yes, you read it right. Today, we're gonna have a small article about valentine's day.
<h2>Who?</h2>
Saint Valentine's Day (commonly simply Valentine's Day) is an annual holiday held on February 14 celebrating love and affection between intimate companions. It is traditionally a day on which loves express their love for each other by presenting flowers, offering confectionery, and sending greeting cards (known as "valentines").
<h2>Spreading the love, check this out!</h2>
From my geeky heart, here I am presenting beautiful Valentine's Day Wallpapers to decorate your desktop and web applications to match with the theme this lovely month of February.

<div class="clear"></div>

<div class="one_third">

		<div class="featured">
			<div class="t" style="background-color:#980000; color:#ffffff">Twitter In Love</div>
		<div class="c" style="height:185px">
	
<a href="http://content.wallpapers-room.com/resolutions/1280x960/I/Wallpapers-room_com___I_didn__t_mean_you_are_fat_by_Maquita_1280x960.jpg"><img class="aligncenter size-full wp-image-273" title="twitter in love" src="http://andyph.info/wp-content/uploads/2011/02/twitter-in-love.jpg" alt="" width="245" height="178" /></a>
</div></div>
</div>

<div class="one_third last">

		<div class="featured">
			<div class="t" style="background-color:#980000; color:#ffffff">Sheep In Love</div>
		<div class="c" style="height:185px">
	
<a href="http://flameia.com/index.php?ct=desktops&amp;ds=holidays&amp;dp=1"><img class="aligncenter size-full wp-image-272" title="sheep in love" src="http://andyph.info/wp-content/uploads/2011/02/sheep-in-love.jpg" alt="" width="245" height="178" /></a>
</div></div>
</div><div class="clear"></div>

<div class="one_third">

		<div class="featured">
			<div class="t" style="background-color:#980000; color:#ffffff">Seriously In Love</div>
		<div class="c" style="height:185px">
	
<a href="http://www.sitereviver.com/images/feb10/val14.jpg"><img class="aligncenter size-full wp-image-271" title="seriously in love" src="http://andyph.info/wp-content/uploads/2011/02/seriously-in-love.jpg" alt="" width="245" height="178" /></a>
</div></div>
</div>

<div class="one_third last">

		<div class="featured">
			<div class="t" style="background-color:#980000; color:#ffffff">Love Under the Light</div>
		<div class="c" style="height:185px">
	
<a href="http://www.sitereviver.com/images/2010/val111.jpg"><img class="aligncenter size-full wp-image-270" title="love under the lights" src="http://andyph.info/wp-content/uploads/2011/02/love-under-the-lights.jpg" alt="" width="245" height="178" /></a>
</div></div>
</div><div class="clear"></div>

<div class="one_third">

		<div class="featured">
			<div class="t" style="background-color:#980000; color:#ffffff">Hear my Love</div>
		<div class="c" style="height:185px">
	
<a href="http://www.sitereviver.com/images/2010/val333.jpg"><img class="aligncenter size-full wp-image-269" title="hearing my love" src="http://andyph.info/wp-content/uploads/2011/02/hearing-my-love.jpg" alt="" width="245" height="178" /></a>
</div></div>
</div>

<div class="one_third last">

		<div class="featured">
			<div class="t" style="background-color:#980000; color:#ffffff">Fairy In Love</div>
		<div class="c" style="height:185px">
	
<a href="http://www.sitereviver.com/images/feb10/val6.jpg"><img class="aligncenter size-full wp-image-268" title="fairy in love" src="http://andyph.info/wp-content/uploads/2011/02/fairy-in-love.jpg" alt="" width="245" height="178" /></a>
</div></div>
</div><div class="clear"></div>

<div class="one_third">

		<div class="featured">
			<div class="t" style="background-color:#980000; color:#ffffff">Cupid of New Generation?</div>
		<div class="c" style="height:185px">
	
<a href="http://www.sitereviver.com/images/feb10/val11.jpg"><img class="aligncenter size-full wp-image-267" title="Cupid of New Generation" src="http://andyph.info/wp-content/uploads/2011/02/cupid-kuno.jpg" alt="" width="245" height="178" /></a>
</div></div>
</div>

<div class="one_third last">

		<div class="featured">
			<div class="t" style="background-color:#980000; color:#ffffff">Puppy Love</div>
		<div class="c" style="height:185px">
	
<a href="http://www.sitereviver.com/images/feb10/val4.jpg"><img class="aligncenter size-full wp-image-266" title="Puppy Love" src="http://andyph.info/wp-content/uploads/2011/02/children-in-love.jpg" alt="" width="245" height="178" /></a>
</div></div>
</div><div class="clear"></div>

<div class="one_third">

		<div class="featured">
			<div class="t" style="background-color:#980000; color:#ffffff">Bunny In Love</div>
		<div class="c" style="height:185px">
	
<a href="http://www.sitereviver.com/images/feb10/val12.jpg"><img class="aligncenter size-full wp-image-265" title="bunny in love" src="http://andyph.info/wp-content/uploads/2011/02/bunny-in-love.jpg" alt="" width="245" height="178" /></a>
</div></div>

</div>
<div class="clear"></div>
<h3>Andy's Web wishes everyone a very Happy Valentine's Day.</h3>
]]></content:encoded>
			<wfw:commentRss>http://andyph.info/blog/2011/love-is-in-the-air-valentines-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where Your Phone Is Made</title>
		<link>http://andyph.info/blog/2011/where-your-phone-is-made/</link>
		<comments>http://andyph.info/blog/2011/where-your-phone-is-made/#comments</comments>
		<pubDate>Fri, 11 Feb 2011 09:52:02 +0000</pubDate>
		<dc:creator>Andy Christian Loyola</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Cellphone]]></category>
		<category><![CDATA[Mobile Phone]]></category>

		<guid isPermaLink="false">http://andyph.info/?p=242</guid>
		<description><![CDATA[What? I'm a fanatic of mobile phones since my secondary years and I still remembered that my first mobile phone was called "Trium" and after ]]></description>
			<content:encoded><![CDATA[
<h2>What?</h2>
I'm a fanatic of mobile phones since my secondary years and I still remembered that my first mobile phone was called "Trium" and after a couple of years I spent in using that mobile phone, I shift on using the "Nokia 3310". And whenever we plan on buying a new phone - we ask the store if where this phone's been made from. We basically look at the back of the phone under the battery compartment and look for the "Made in ____" word. 

<div class="clear"></div>
<div class="one_third">

		<div class="featured">
			<div class="t" style="background-color:#343f44; color:#FFF">Trium Mobile Phone</div>
		<div class="c" style="height:185px">
	
<a rel="prettyPhoto" href="http://andyph.info/wp-content/uploads/2011/02/trium.jpg"><img class="alignnone size-full wp-image-244" title="trium" src="http://andyph.info/wp-content/uploads/2011/02/trium.jpg" alt="" width="218" height="152" /></a> 
</div></div>
</div>

<div class="one_third last">

		<div class="featured">
			<div class="t" style="background-color:#343f44; color:#FFF">Trium Mobile Phone</div>
		<div class="c" style="height:185px">
	
<a rel="prettyPhoto" href="http://andyph.info/wp-content/uploads/2011/02/nokia-3310.jpg"><img class="alignnone size-full wp-image-243" title="nokia-3310" src="http://andyph.info/wp-content/uploads/2011/02/nokia-3310.jpg" alt="" width="236" height="155" /></a>
</div></div>
</div><div class="clear"></div>
<div class="clear"></div>

What do don't know is that "where does your phone being manufactured / where your phone is made specially the overall structure of your phone. From the motherboard up to small pieces of electronics you found on your phone. "

I found an intriguing site wherein you can actually identify where your phone is made by following these steps:
<h2>Check this out!</h2>
1st, type in *#06# and the international mobile equipment identity number appears

Check the 7th and 8th numbers.
<ul>
	<li>If the 7th and 8th digits are 02 or 20 this means your cell phone was assembled in China which is low quality</li>
	<li>If the 7th and 8th digits are 08 or 80 this means your cell phone was manufactured in Germany which is fair quality</li>
	<li>If the 7th and 8th digits are 01 or 10 this means your cell phone was manufactured in Finland which is very good</li>
	<li>If the 7th and 8th digits are 00 this means your cell phone was manufactured in original factory which is the best mobile quality</li>
	<li>If the 7th and 8th digits are 13 this means your cell phone was assembled in Azerbaijan which is very Bad quality and also dangerous for your health</li>
</ul>
Hope this helps identifying your phone's origin.
]]></content:encoded>
			<wfw:commentRss>http://andyph.info/blog/2011/where-your-phone-is-made/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cross-Site Scripting (XSS)</title>
		<link>http://andyph.info/blog/2011/cross-site-scripting-xss/</link>
		<comments>http://andyph.info/blog/2011/cross-site-scripting-xss/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 17:54:07 +0000</pubDate>
		<dc:creator>Andy Christian Loyola</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Cross-Site Scripting]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP Security]]></category>
		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://andyph.info/?p=235</guid>
		<description><![CDATA[What? Cross-site scripting vulnerability is the most common form of attack on websites. The mistake made by developers is not filtering input data from web ]]></description>
			<content:encoded><![CDATA[<h2>What?</h2>
<p>Cross-site scripting vulnerability is the most common form of attack on  websites. The mistake made by developers is not filtering input data  from web forms and not escaping the output.</p>
<p>For example, you have a form like this:</p>
<p>[html]</p>
<form action="process.php" accept-charset="utf-8" enctype="multipart/form-data" method="post"> <textarea id="txtMessage" name="txtMessage"></textarea></p>
<input id="submit" name="submit" type="submit" value="Send" /> </form>
<p>[/html]</p>
<p>The app will display something like this:</p>
<p>[php]<br />
echo $_POST['txtMessage'];<br />
[/php]</p>
<p>The vulnerability is that the application doesn’t filter the input and  escape the output. Let’s say someone writes the following javascript in  the comment textarea:</p>
<p>[javascript]<br />
alert (&#8216;hacked&#8217;);<br />
[/javascript]</p>
<p>If an application doesn’t escape this output on every page request a Javascript alert box will pop up. The best a developer can do is to filter out any HTML tags from the data with:</p>
<p>[php]<br />
$clean_message = strip_tags($_POST['txtComment']);<br />
[/php]</p>
<p>And escape it when outputting the date with htmlentities:</p>
<p>[php]<br />
htmlentities($clean_message, ENT_QUOTES, &#8216;UTF-8&#8242;);<br />
[/php]</p>
<p>A better solution is to use <a href="http://htmlpurifier.org/">HTML Purifier</a> to filter out any unwanted malicious input and to test your web forms that it’s XSS proof use the <a href="http://ha.ckers.org/xss.html">XSS cheat sheet</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://andyph.info/blog/2011/cross-site-scripting-xss/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Disable Directory Browsing Using .htaccess</title>
		<link>http://andyph.info/blog/2011/disable-directory-browsing-using-htaccess/</link>
		<comments>http://andyph.info/blog/2011/disable-directory-browsing-using-htaccess/#comments</comments>
		<pubDate>Thu, 10 Feb 2011 08:31:09 +0000</pubDate>
		<dc:creator>Andy Christian Loyola</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[Apache]]></category>

		<guid isPermaLink="false">http://andyph.info/?p=231</guid>
		<description><![CDATA[What? Apache web server allow directory browsing by default. It’s always good to disable directory browsing in security aspect. To disable directory browsing in apache ]]></description>
			<content:encoded><![CDATA[<h2>What?</h2>
<p>Apache web server allow directory browsing by default. It’s always good  to disable directory browsing in security aspect. To disable directory  browsing in apache web server you need to edit the httpd.conf or  .htaccess</p>
<h2>Solutions</h2>
<ul>
<li>
<h3>Using .htaccess&#8230; follow the 2 simple steps</h3>
</li>
</ul>
<ol>
<li>Open your .htacces file</li>
<li>If Options Indexes exists, modify it to Options -Indexes or add the Options -Indexes if not exist as a new line</li>
</ol>
<ul>
<li>
<h3>Using httpd.conf&#8230; follow the 4 simple steps</h3>
</li>
</ul>
<ol>
<li>Open your httpd.conf, if you&#8217;re using linux; it should be normally located @ /usr/local/apache/conf or /etc/httpd.conf, if you&#8217;re using windows (xampp) it should be @ C:\xampp\apache\conf &#8211; replace the drive letter with your correct one</li>
<li>Go to your own Virtual Host settings and look for Options Indexes</li>
<li>Change the Indexes to -Indexes if Option Indexes exist or add the Options -Indexes if not exist</li>
<li>Restart your apache web server</li>
</ol>
<ul>
<li>
<h3>Using Cpanel Share Hosting&#8230; follow the 4 simple steps</h3>
</li>
</ul>
<ol>
<li>Login to your Cpanel</li>
<li>Click on Index Manager</li>
<li>Directory will be list. Click on the directory name which you want to disable the directory browsing</li>
<li>Select No Index and click save</li>
</ol>
<h2>Recommendation</h2>
<p>For techie guy like me, I would recommend using .htaccess to disable directory browsing. Though I&#8217;m familiar with Cpanel and use it a lot but I feel more secure to do it via .htaccess. Well, it&#8217;s up to you guys on which on the 3 solutions you&#8217;re comfortable working with.</p>
]]></content:encoded>
			<wfw:commentRss>http://andyph.info/blog/2011/disable-directory-browsing-using-htaccess/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Password Hashing</title>
		<link>http://andyph.info/blog/2011/password-hashing/</link>
		<comments>http://andyph.info/blog/2011/password-hashing/#comments</comments>
		<pubDate>Wed, 09 Feb 2011 14:30:12 +0000</pubDate>
		<dc:creator>Andy Christian Loyola</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP Security]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://andyph.info/?p=190</guid>
		<description><![CDATA[What? Accepting passwords from users comes with great deal of responsibility &#8211; just like Spider-Man, &#8220;With great power comes great responsibility&#8221;. As web developers, we ]]></description>
			<content:encoded><![CDATA[<h2>What?</h2>
<p>Accepting passwords from users comes with great deal of responsibility &#8211; just like Spider-Man, &#8220;With great power comes great responsibility&#8221;.</p>
<p>As web developers, we are generally satisfied when a user provides correct information to gain access to sensitive data contained in the website. It is our duty to protect the end user from attack by entrusting the passwords they provide do not fall into the hands of evil in the even that not only their sacred information becomes compromised but also our application. The best way to protect user passwords is through hashing, and we&#8217;ll go over how to do that.</p>
<h2>How?</h2>
<p>There are several built-in functions for hashing strings in PHP, such as <a href="http://php.net/md5">md5()</a>, <a href="http://php.net/sha1">sha1()</a>,  or stronger. There are pros and cons to each of the available methods,  but these are beyond the scope of this article. The important thing is  that the method we choose only work one-way, in that once we hash the  password, we are unable to get the original from the hashed string.  Therefore, something like <a href="http://php.net/mcrypt">mcrypt()</a> or <a href="http://php.net/base64_encode">base64_encode</a> simply will not do.</p>
<p>The following snippet shows how to encode a string using the <a href="http://php.net/sha1">sha1()</a> function:</p>
<p>[php]<br />
&lt;?php<br />
// Original password<br />
$password = &#8216;password&#8217;;</p>
<p>// Hash that password!<br />
$hashed = sha1($password);</p>
<p>// Now the password is:<br />
// 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8<br />
print $hashed;<br />
?&gt;<br />
[/php]</p>
<p>This solution is pretty good and we can put this up in the database and we call it a day.</p>
<h2>Problem</h2>
<p>The problem is, that people tend to use common passwords: things in  the dictionary, commonly-used words, kid&#8217;s names, dates, and other  easy-to-guess stuff. An attacker knows this, and they may employ a <a href="http://en.wikipedia.org/wiki/Dictionary_attack">dictionary attack</a> to try and brute-force commonly used passwords encoded with the known  hash algorithms. We can thwart this process by adding some additional  entropy to our passwords, in the form of a salt.</p>
<h2>Solution</h2>
<h3>Using Salt on a Password</h3>
<p>Salt is an extra baggage but really useful and it will give password the extra protection, in short &#8211; makes the password more difficult to brute-force. There are countless ways to salt  passwords, but whichever method we choose, one thing is certain: we have  to store the salt. It is very important that the salt we use be kept in  a safe place, or, for maximum security, that the salt be unique for  each hashed password. We&#8217;ll cover each method separately.</p>
<p>Using salt in the earlier code:<br />
[php]<br />
// Original password<br />
$password = &#8217;password&#8217;;</p>
<p>// Add some salt<br />
$salt = &#8217;SecretIngredient&#8217;;<br />
$salted_password = $password . $salt;</p>
<p>// Hash that password!<br />
$hashed = sha1($salted_password);</p>
<p>// Now the password is:<br />
// 1ad8b50cb8f1cdbd2536a1efa4ccffcbbe4302d0<br />
print $hashed;<br />
?&gt;<br />
[/php]</p>
<p>Another simple yet complex hashed password:<br />
[php]<br />
<?php<br />
// Original password<br />
$password = &#8216;password&#8217;;</p>
<p>// Add some stronger salt<br />
$salt = &#8216;__PPbdb10_MORE_SALTY!_3&#038;%df9++*$&#038;&#8217;;<br />
$salted_password = $salt . $password . $salt;</p>
<p>// Hash that password!<br />
$hashed = sha1(sha1($salt) . md5($salted_password));</p>
<p>// Now the password is much more complex!<br />
print $hashed;<br />
?><br />
[/php]</p>
]]></content:encoded>
			<wfw:commentRss>http://andyph.info/blog/2011/password-hashing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

