<?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>ZaneHooper.com</title>
	<atom:link href="http://zanehooper.com/feed" rel="self" type="application/rss+xml" />
	<link>http://zanehooper.com</link>
	<description>Web developer, designer, and Internet Entrepreneur</description>
	<lastBuildDate>Sat, 17 Dec 2011 21:52:18 +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>FFMPEG for Steaming</title>
		<link>http://zanehooper.com/blog/ffmpeg-for-steaming.html</link>
		<comments>http://zanehooper.com/blog/ffmpeg-for-steaming.html#comments</comments>
		<pubDate>Sat, 17 Dec 2011 21:52:18 +0000</pubDate>
		<dc:creator>Zane Hooper</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zanehooper.com/?p=67</guid>
		<description><![CDATA[While working on Gamevue (Gamevue.net), I had to find a high-quality compression for FLV that would stream with the lowest bandwidth possible. First of all, http://ubuntuforums.org/showthread.php?t=786095 is a great tutorial for installing FFMPEG. In my case, it was actually installed on Debian through SSH. Also, http://www.kilobitspersecond.com/2007/05/24/ffmpeg-quality-comparison/ does a very good job of looking into the different qscale options. For [...]]]></description>
			<content:encoded><![CDATA[<p>While working on Gamevue (Gamevue.net), I had to find a high-quality compression for FLV that would stream with the lowest bandwidth possible.</p>
<p>First of all, <a href="http://ubuntuforums.org/showthread.php?t=786095">http://ubuntuforums.org/showthread.php?t=786095</a> is a great tutorial for installing FFMPEG. In my case, it was actually installed on Debian through SSH.</p>
<p>Also, <a href="http://www.kilobitspersecond.com/2007/05/24/ffmpeg-quality-comparison/">http://www.kilobitspersecond.com/2007/05/24/ffmpeg-quality-comparison/</a> does a very good job of looking into the different qscale options.</p>
<p>For a video, I chose my friend Ron&#8217;s video named &#8220;potter&#8221; which is about 5 minutes long, 720p, and around 450MB in size before any sort of compression. Note that this takes a while to convert if you don&#8217;t have a very fast server.</p>
<p>The code:</p>
<pre>ffmpeg -i /path/potter.mp4 -qscale {QSCALE} -ar {ARATE} -ac 2 -acodec {ACODEC} -vcodec {VCODEC} -ab {ABITRATE} -f flv -s 1280x720 /path/potter_{ARATE}_{ABITRATE}_720p.flv</pre>
<p>After a few tests with different video codecs, I chose libx264. After messing with a different video from Ron, I was very happy with the results.<br />
Before conversion: <a href="http://localhostr.com/files/F6c63r0/capture.png">http://localhostr.com/files/F6c63r0/capture.png</a> (29.3 MB)<br />
After conversion: <a href="http://localhostr.com/files/RufUdEt/capture.png">http://localhostr.com/files/RufUdEt/capture.png</a> (6.7 MB)</p>
<p>The converted file&#8217;s size was only 23% of the original file&#8217;s size with an audio rate of 22050 Hz, video codec libx264, and the audio codec libfaac.</p>
<p><strong>More Tests (audio)</strong></p>
<p>I tried 22050 and 44100 as the audio rates and 196k and 256k as the audio bit rates and LAME MP3 and AAC as the audio codecs.<br />
The results were quite similar to each other.</p>
<pre>gamevue:/path# du potter*
121596  potter_22050_196k_720p.flv
124824  potter_22050_196k_LAME_720p.flv
121596  potter_22050_256k_720p.flv
124824  potter_22050_256k_LAME_720p.flv
124528  potter_44100_196k_720p.flv
126016  potter_44100_196k_LAME_720p.flv
124528  potter_44100_256k_720p.flv
128408  potter_44100_256k_LAME_720p.flv</pre>
<p>The quality difference in audio was not very much going from LAME to AAC, but it did shave off almost 4MB on the higher quality audio file.<br />
Audio Codec chosen: AAC (libfaac)<br />
Video Codec chosen: x264 (libx264)<br />
Audio Rate chosen: 44100<br />
Audio Bit Rate chosen: 256k</p>
]]></content:encoded>
			<wfw:commentRss>http://zanehooper.com/blog/ffmpeg-for-steaming.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Business Build (feat. USB 3, RAID 0 SATA III SSDs, 2nd gen. core i7)</title>
		<link>http://zanehooper.com/blog/business-build-feat-usb-3-raid-0-sata-iii-ssds-2nd-gen-core-i7.html</link>
		<comments>http://zanehooper.com/blog/business-build-feat-usb-3-raid-0-sata-iii-ssds-2nd-gen-core-i7.html#comments</comments>
		<pubDate>Tue, 06 Dec 2011 23:20:35 +0000</pubDate>
		<dc:creator>Zane Hooper</dc:creator>
				<category><![CDATA[Computer Builds]]></category>

		<guid isPermaLink="false">http://zanehooper.com/?p=52</guid>
		<description><![CDATA[Business Build!
2x OCZ Vertex 3 120GB SSDs
Intel Core i7 2600k Sandy Bridge (3.4GHz)
GIGABYTE Intel Z68 USB 3.0 SATA III
Microsoft Windows 7 Professional 64-bit
4x G-Skill Ripjaws X series GB DDR3 1333
GeForce GTS 450 (Fermi) 1GB 128-bit GDDR5
Coolmax 700W ATX 12V v2.2
APEVIA full tower case]]></description>
			<content:encoded><![CDATA[<p>My dad requested a build for his business computer that needed to be stable, reliable, and fast. It was Black Friday that he asked for a quote, so of course by the next day two or three of the deals were gone, but it was a pretty close estimate.</p>
<p>Part List (view below for more info):</p>
<ul>
<li>2x OCZ Vertex 3 120GB SSDs</li>
<li>Intel Core i7 2600k Sandy Bridge (3.4GHz)</li>
<li>GIGABYTE Intel Z68 USB 3.0 SATA III</li>
<li>Microsoft Windows 7 Professional 64-bit</li>
<li>4x G-Skill Ripjaws X series GB DDR3 1333</li>
<li>GeForce GTS 450 (Fermi) 1GB 128-bit GDDR5</li>
<li>Coolmax 700W ATX 12V v2.2</li>
<li>APEVIA full tower case</li>
</ul>
<p>First of all, it needed to be capable of SATA III and USB 3 for speed reasons (most mobos these days are either both or neither, so that part wasn&#8217;t hard), so I got the latest <strong>core i7 quad core</strong> (<a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16819115070">N82E16819115070</a>)with a<strong> Gigabyte Z68</strong> (<a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16813128507">N82E16813128507</a>) combo ($470).</p>
<p>He wanted a really fast boot up so I got <strong>two OCZ Vertex 3 120GB SATA III SSDs </strong>(<a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16820227706">N82E16820227706</a>) and put them in RAID 0 (read more about this later). This was very pricey, costing a solid $380.</p>
<p>For extreme multitasking capabilities, I got a total of <strong>16GB G-Skill Ripjaws X series DDR3 1333</strong> (PC3 10666) (2x <a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16820231426">N82E16820231426</a>) ram for $60.</p>
<p>He also wanted to be able to run business programs well and handle multiple monitors with ease, so I splurged a little and got a <strong>GeForce GTS 450 (Fermi) 1GB 128-bit GDDR5</strong> (<a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16814134119">N82E16814134119</a>) for $110. This may be a little bit of overkill for a Business computer but I figured by the time Windows 8 gets replaced, this thing will be getting ancient. Plus, it has 3D vision capabilities and such, which I&#8217;m hoping will be the norm in the near future.</p>
<p>Because it&#8217;s a business computer that probably wouldn&#8217;t be overclocked, I didn&#8217;t need a fancy case, so I got an APEVIA full tower (<a href="http://www.newegg.com/Product/Product.aspx?Item=N82E16811144202">N82E16811144202</a>) for $70 (+$20 shipping).</p>
<p>Windows 7 pro system builder was $140, and a generic CD/DVD burner was $18.</p>
<p>The total cost turned out to be <strong>$1335</strong>, which is an <strong>extremely</strong> low price for how fast this computer is.</p>
<p><strong>The Tech Details</strong></p>
<p>First of all, the case was not as good as I hoped in many cases. The default SSD 2.5&#8243; to 3.5&#8243; adapter that came with the vertex didn&#8217;t work at all with the &#8220;easy to use&#8221; no-tools mounting system (which was nice once I grabbed an extra adapter I had laying around). Additionally, these plastic mounting pieces were very fragile.  Quite frankly, I don&#8217;t completely trust them to hold in a hard drive. The back of the case is VERY flimsy (it&#8217;s aluminum), making changing ram sticks surprisingly annoying because the part that the motherboard is screwed into kept bending back and forth while pushing. Other than that, the case was pretty good. The lighting was good looking (not gaudy or anything), and the built-in fan controller was pretty cool (no pun intended). My final take on the case: <strong>great</strong> deal <strong>for the price</strong>, which was only $70 + $20 shipping when I got it. Not too great build quality, but I have a feeling Apevia will be pretty good once they fix some of these design issues.</p>
<p>The PSU I got was obviously made for a mid-tower case. There were not many 4-pin fan plugs and the wires were pretty short (I had to put my SSDs on the top part of the drive bay, otherwise the cords would not have reached). It was a surprisingly small PSU (considering I&#8217;m used to working with significantly larger ones) which was not a bad thing. The optional plugins are handy, but the fact that there were only three was weird, and one is taken if you want to have a graphics card (there is no graphics power plugin by default, you have to add the SLI optional plug). Even with all of the optional plugs, I had to double up on some of the fan plugs (plug two into one). My take on this PSU: <strong>great</strong> for a <strong>mid-tower</strong> but<strong> </strong>not for a full tower. I would buy it again if I were buying a mid-tower for sure.</p>
<p>This motherboard was great. It fit right into the case, boots up pretty fast, and has a lot of features (which I will go over soon). It has a total of four SATA III and four SATA II connections, which is more than enough in my case. The first thing I did when I booted up was look through the BIOS which was very promising. It had a lot of Overclock settings for the faint of heart or even the experts, with pre-defined settings or manually set options. Changing the RAM clock took almost no time at all. Driver install for this thing was incredibly easy. I popped the CD in, checked which things I wanted to install, and clicked Install, then it lead me to more additional drivers I could choose from. Their Smart 6 tool is awesome. You can choose from different BIOS settings with different users/passwords and different settings, overclock the processor (with a GUI and everything), and more. The Smart 6 overclock tool is really simple, you just click which setting of overclock you want, and it does it and applies the setting at restart. Also, the Intel Smart Response Technology (ISRT) that the motherboard installed was really nice for RAID management. It let me set up new raid volumes, manage drives, change the RAID type of predefined RAID volumes (I sent it right from RAID 1 to RAID 0 with no difficulty), and more with a nice GUI too. My final take on the motherboard: <strong>great deal for any one!</strong> I would certainly buy one again.</p>
<p>As usual G-Skill is awesome. I&#8217;ve had over 60 GB worth of 4GB sticks from them and haven&#8217;t had a problem with any of them yet.</p>
<p>Now for the fun part: the SSDs. These things are <strong>FAST</strong>. They worked right out of the box (no firmware updates or anything). I set them up in RAID 1 (changed later) at first for redundancy, which gave me ~112GB of disk space, and when I ran Crystal Disk Mark, I was pretty happy with the results: 700MB/s seq read and 133MB/s seq write. Note that in RAID 1, the total disk space is the size of the highest disk size (112GB), but if one drive fails, the other can keep going. Then I switched them to RAID 0 for speed, which gave me a good 224GB of disk space and rocked a solid 815MB/s seq read and 322MB/s seq write! While installing Windows 7, the &#8220;Copying Windows Files&#8221; section went straight from 0% to 100% hitting no point in between in a split second. I thought that was pretty amusing.  With no software optimization (e.g. registry edits) Windows went from BIOS to login in 8 seconds flat (the average windows installation usually takes about 20 seconds).</p>
<p>Windows Experience Index:<br />
Processor: 7.6 (before any overclock)<br />
Memory: 7.6 (before any overclock)<br />
Graphics: 7.0<br />
Gaming Graphics: 7.0<br />
Primary Hard Disk: 7.9</p>
<p>Windows Experience Index measures performance on a scale of 1.0 to 7.9</p>
<p>Overall: <strong>loved the build</strong>! Crazy fast, no problems with setups. The bottleneck: graphics (not a problem in this case).</p>
<p>He&#8217;s running dual monitors right now, but I might add a second graphics card (probably just a $50 generic one) for another two (total of four).</p>
]]></content:encoded>
			<wfw:commentRss>http://zanehooper.com/blog/business-build-feat-usb-3-raid-0-sata-iii-ssds-2nd-gen-core-i7.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zero Remorse&#8217;s Complete Reconstruction</title>
		<link>http://zanehooper.com/blog/zero-remorses-complete-reconstruction.html</link>
		<comments>http://zanehooper.com/blog/zero-remorses-complete-reconstruction.html#comments</comments>
		<pubDate>Tue, 12 Oct 2010 04:35:05 +0000</pubDate>
		<dc:creator>Zane Hooper</dc:creator>
				<category><![CDATA[Jobs]]></category>
		<category><![CDATA[New Jobs]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zanehooper.com/?p=43</guid>
		<description><![CDATA[Zero Remorse, a professional Australian gaming team,  has asked for a complete reconstruction of their website. I&#8217;m developing the PHP and MySQL server-side and the XHTML, CSS, JS, jQuery, and AJAX client-side. This includes incorporation into a PHPBB forums system, a recent, upcoming, and current matches feature, and much more.]]></description>
			<content:encoded><![CDATA[<div id="attachment_44" class="wp-caption alignnone" style="width: 597px"><a href="http://zanehooper.com/wp-content/uploads/zero-remorse.jpg"><img class="size-large wp-image-44    " style="margin-top: 10px; margin-bottom: 10px;" title="Zero Remorse" src="http://zanehooper.com/wp-content/uploads/zero-remorse-1024x457.jpg" alt="Zero Remorse" width="587" height="262" /></a><p class="wp-caption-text">Zero Remorse&#39;s new template</p></div>
<p><a title="Zero Remorse: Australian Gaming Team" href="http://www.zero-remorse.net/" target="_blank">Zero Remorse</a>, a professional Australian gaming team,  has asked for a complete reconstruction of their website. I&#8217;m developing the PHP and MySQL server-side and the XHTML, CSS, JS, jQuery, and AJAX client-side. This includes incorporation into a PHPBB forums system, a recent, upcoming, and current matches feature, and much more.</p>
]]></content:encoded>
			<wfw:commentRss>http://zanehooper.com/blog/zero-remorses-complete-reconstruction.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EoReality&#8217;s New Website</title>
		<link>http://zanehooper.com/blog/eorealitys-new-website.html</link>
		<comments>http://zanehooper.com/blog/eorealitys-new-website.html#comments</comments>
		<pubDate>Tue, 12 Oct 2010 04:05:55 +0000</pubDate>
		<dc:creator>Zane Hooper</dc:creator>
				<category><![CDATA[Jobs]]></category>
		<category><![CDATA[New Jobs]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zanehooper.com/?p=35</guid>
		<description><![CDATA[Well, this is posted a few months after the actual completion and launch of EoReality&#8216;s new template. This template was designed by sYnergy Forge (check them out, my favorite game/clan template designer I&#8217;ve ever seen) and coded in XHTML/PHP/CSS and some jQuery/Javascript/AJAX. About EoReality: By providing the highest quality performance servers in the industry, EoReality [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://eoreality.net" style="margin-right:10px;margin-bottom:10px;"><img class="alignleft" title="EoReality" src="http://zanehooper.com/wp-content/uploads/EoR.jpg" alt="EoReality" width="602" height="269" /></a></p>
<p>Well, this is posted a few months after the actual completion and launch of <a title="EoReality Hosting" href="http://eoreality.net" target="_blank">EoReality</a>&#8216;s new template. This template was designed by <a title="sYnergy Forge Design" href="http://www.synergy-forge.com/" target="_blank">sYnergy Forge</a> (check them out, my favorite game/clan template designer I&#8217;ve ever seen) and coded in XHTML/PHP/CSS and some jQuery/Javascript/AJAX.</p>
<p><strong>About </strong><a title="EoReality" href="http://EoReality.net" target="_blank"><strong>EoReality</strong></a><strong>:</strong></p>
<p>By providing the highest quality performance servers in the industry, <a title="EoReality" href="http://eoreality.net" target="_blank">EoReality</a> has gained the trust of top teams, organizations, and players. <a title="EoReality Hosting" href="http://eoreality.net" target="_blank">EoReality</a> runs its highly optimized servers on premium networks to ensure the lowest possible pings, best trace routes and accurate hit registration. What are you waiting for? Stop playing and start gaming. <a title="EoReality" href="http://eoreality.net" target="_blank">End of Reality</a>.</p>
<p><a title="EoReality Hosting" href="http://eoreality.net" target="_blank">EoReality</a> now provides hosting for my server(s), which allows upload speeds of up to 1gbps (as if that high is even needed) because it runs on Google Fiber&#8217;s new super-fast network.</p>
<p><strong>Note:</strong> <a title="EoReality Hosting" href="http://eoreality.net" target="_blank">EoReality</a> will be replacing the template I developed with a new one in the near future, so sorry if mine isn&#8217;t there any more.</p>
<p style="text-align: center;">
]]></content:encoded>
			<wfw:commentRss>http://zanehooper.com/blog/eorealitys-new-website.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Security: Part 2 &#8211; Protecting vulnerable files</title>
		<link>http://zanehooper.com/blog/php-security-part-2-protecting-vulnerable-files.html</link>
		<comments>http://zanehooper.com/blog/php-security-part-2-protecting-vulnerable-files.html#comments</comments>
		<pubDate>Mon, 12 Jul 2010 03:01:29 +0000</pubDate>
		<dc:creator>Zane Hooper</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://zanehooper.com/?p=25</guid>
		<description><![CDATA[While developing, a lot of files are files you don&#8217;t want users to see &#8211; whether they are admin, config, or page files &#8211; should be well secured. Admin Files You&#8217;re administrative home page (if you have an administration panel) should require the user to be of a certain level (state, whatever you want to [...]]]></description>
			<content:encoded><![CDATA[<p>While developing, a lot of files are files you don&#8217;t want users to see &#8211; whether they are admin, config, or page files &#8211; should be well secured.</p>
<p><strong>Admin Files</strong></p>
<p>You&#8217;re administrative home page (if you have an administration panel) should require the user to be of a certain level (state, whatever you want to call it) or in a certain user group. This value SHOULD NOT be stored in a cookie. Cookies can be modified too easily, and a nosy hacker would be able to be in your admin panel in seconds.</p>
<p>If you have properly secured your admin panel so that a regular user cannot access it, the next step is to secure the files (assuming you&#8217;re using a paged interface, which I will explain here).</p>
<p>A paged interface is one in which there is a home page that includes files in a pages folder of some sort. There are multiple insecurities that I will cover with this:</p>
<ol>
<li>Users accessing the directory of the pages</li>
<li>Users accessing other directories through this system</li>
</ol>
<p><strong>1. Users accessing the directory of the pages</strong></p>
<p>This can happen through multiple ways. One thing you must do is make sure that the file exists using if( file_exists( $file_name ) ), otherwise a user could enter an incorrect value and PHP will try to include a page that doesn&#8217;t exist. This step covers up your tracks for hiding the directory.</p>
<p>Next, you want to protect the files of the directory. My favorite way to do this is through a .htaccess file (for apache users). In the pages directory, add a .htaccess file with the contents:</p>
<div id="_mcePaste">RewriteEngine on</div>
<div id="_mcePaste">RewriteRule ^(.*)$ /path/to/where/they/should/go.php [L] #Security: Does not allow anyone into anywhere in this folder. Includes still work.</div>
<p>This protects the path and sends the user to the specified path. This could be a home page, a 404 error, page, or whatever you want. I do know that some people don&#8217;t like this method, or don&#8217;t have Apache, so the other way would be to use define( &#8216;SITE&#8217;, true ); in your index page and then add at the beginning of everyone of your pages, add if( !defined(&#8216;SITE&#8217;) ) die( &#8216;Hey! You\&#8217;re not supposed to be here!&#8217; );</p>
<p>These methods protect your pages directory from direct access but still allow use of PHP&#8217;s include(  ), include_once(  ), require(  ), and require_once(  ) functions.</p>
<p><strong>2. Users accessing other directories through this system</strong></p>
<p>This is a pretty simple hack that I found once while testing out the security of my files. I thought &#8220;Well, if I can access anything in the pages directory, what&#8217;s to keep me from accessing other directories?&#8221;</p>
<p>This hack is quite simple actually, and allows the hacker to figure out entire directories of a website and generate plenty of errors. As I said in Part 1, to be good at security you need to learn to hack first. So here&#8217;s how the hack works:</p>
<p>[Some Website]/index.php?page=ucp</p>
<p>Seems pretty simple right? That&#8217;s how links work. The PHP script then performs include( &#8216;pages/ucp.php&#8217; ), but what if we change UCP?</p>
<p>[Some Website]/index.php?page=../index</p>
<p>Hmm&#8230; PHP interprets this as include( &#8216;pages/../index.php&#8217; ), which includes the index page again. Now we start getting errors. Actually, now it includes the index page over and over until the page breaks. Now the user can do some snooping around, with things like:</p>
<p>[Some Website]/index.php?page=../admin/delete_user&amp;id=1</p>
<p>Using things like this the user can access admin/delete_user.php?id=1 and wreak havoc on the website. The simplest protection ever can fix this:</p>
<p>$page = str_replace( &#8216;../&#8217;, &#8221;, $page );</p>
<p>And you&#8217;re done!</p>
<p>Up Next: <strong>PHP Security: Part 3 &#8211; XSS Worms/Hacks</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://zanehooper.com/blog/php-security-part-2-protecting-vulnerable-files.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Security: Part 1 &#8211; SQL Injections</title>
		<link>http://zanehooper.com/blog/php-security-part-1-sql-injections.html</link>
		<comments>http://zanehooper.com/blog/php-security-part-1-sql-injections.html#comments</comments>
		<pubDate>Mon, 12 Jul 2010 02:14:28 +0000</pubDate>
		<dc:creator>Zane Hooper</dc:creator>
				<category><![CDATA[Security]]></category>
		<category><![CDATA[Web Tutorials]]></category>

		<guid isPermaLink="false">http://zanehooper.com/?p=21</guid>
		<description><![CDATA[One of a web developer&#8217;s biggest issues: security. If you don&#8217;t want your data stolen or your user&#8217;s redirected to other sites, there&#8217;s a lot of things you must go through to correct these problems. One of the best ways I find to be able to make a secure website is to try and find [...]]]></description>
			<content:encoded><![CDATA[<p>One of a web developer&#8217;s biggest issues: security. If you don&#8217;t want your data stolen or your user&#8217;s redirected to other sites, there&#8217;s a lot of things you must go through to correct these problems.</p>
<p>One of the best ways I find to be able to make a secure website is to try and find possible insecurities in OTHER websites (AKA, hacking). Try and go to a website and put a few hours into finding a security problem. Maybe your website isn&#8217;t secure against this?</p>
<p><strong>Part 1</strong> &#8211; <em>SQL Injections</em></p>
<p>SQL Injections are one of a programmer&#8217;s biggest nightmares. SQL Injections can be used to steal, delete, or edit data that is supposed to be protected. Like you can use SQL for your websites, SQL might also be able to be injected into your code. Let&#8217;s take a normal login form, for instance:</p>
<blockquote>
<pre>&lt;form method="post"&gt;
&lt;label for="username"&gt;Username:&lt;/label&gt;&lt;input type="text" name="username" id="username" /&gt;
&lt;label for="password"&gt;Password:&lt;/label&gt;&lt;input type="password" name="pass" id="password" /&gt;
&lt;/form&gt;</pre>
</blockquote>
<p>This simple little script will give us a login form. Now the PHP side of things will do something like so:</p>
<blockquote>
<pre>&lt;?php</pre>
<pre>$username = $_POST['username'];</pre>
<pre>$password = $_POST['pass'];</pre>
<pre>$user = mysql_fetch_array( mysql_query( "SELECT `id` FROM `users` WHERE `username` = '{$username}' AND `password` = '{$password}' LIMIT 1" ) );</pre>
<pre>?&gt;</pre>
</blockquote>
<p>Simple enough, right? Maybe you encrypt your password (which we will talk about in another part), but that&#8217;s beside the point.</p>
<p><strong>The Problem: </strong></p>
<p><strong> </strong>Now a hacker would enter something like this into the username field: &#8216; OR &#8217;1&#8242; = &#8217;1&#8242;# and then the query would look like so: <span style="font-family: Consolas, Monaco, 'Courier New', Courier, monospace; line-height: 18px; font-size: 12px; white-space: pre;"> SELECT `id` FROM `users` WHERE `username` = &#8221; OR &#8217;1&#8242; = &#8217;1&#8242;#&#8217; AND `password` = &#8216;{$password}&#8217; LIMIT 1</span></p>
<p>This would allow the hacker to access accounts without even having a password to the account. The # escapes the rest of the query so that SQL doesn&#8217;t take it into account.</p>
<p><strong>The Fix</strong></p>
<p>Now to fix this problem we have to &#8220;escape&#8221; the data. In PHP, a &#8220;\&#8221; before an apostrophe. I use a global clean so I don&#8217;t forget to clean out any inputs. This cleans out ALL cookie, session, POST, GET, and REQUEST data.</p>
<p><em>The Function:</em></p>
<blockquote>
<pre><em>
<div id="_mcePaste"><span style="font-style: normal;">function Clean( $var )</span></div>
<div id="_mcePaste"><span style="font-style: normal;">{</span></div>
<div id="_mcePaste" style="padding-left: 30px;"><span style="font-style: normal;">if( is_array( $var ) )</span></div>
<div id="_mcePaste" style="padding-left: 30px;"><span style="font-style: normal;">{</span></div>
<div id="_mcePaste" style="padding-left: 60px;"><span style="font-style: normal;">foreach( $var as $key =&gt; $val )</span></div>
<div id="_mcePaste" style="padding-left: 60px;"><span style="font-style: normal;">{</span></div>
<div id="_mcePaste" style="padding-left: 90px;"><span style="font-style: normal;">$var[$key] = $this-&gt;Clean( $val );</span></div>
<div id="_mcePaste" style="padding-left: 60px;"><span style="font-style: normal;">}</span></div>
<div id="_mcePaste" style="padding-left: 30px;"><span style="font-style: normal;">}</span></div>
<div id="_mcePaste" style="padding-left: 30px;"><span style="font-style: normal;">elseif( is_string( $var ) )</span></div>
<div id="_mcePaste" style="padding-left: 30px;"><span style="font-style: normal;">{</span></div>
<div id="_mcePaste" style="padding-left: 60px;"><span style="font-style: normal;">$var = str_replace( '\&amp;', '&amp;', escapeshellcmd( htmlentities( $var ) ) );</span></div>
<div id="_mcePaste" style="padding-left: 30px;"><span style="font-style: normal;">}</span></div>
<div id="_mcePaste" style="padding-left: 30px;"><span style="font-style: normal;">else return;</span></div>
<div id="_mcePaste" style="padding-left: 30px;"><span style="font-style: normal;">return $var;</span></div>
<div id="_mcePaste"><span style="font-style: normal;">}</span></div>

</em></pre>
</blockquote>
<p><span style="font-style: normal;">This function grabs $var and cleans all of its values, returning the sanitized variable. The escapeshellcmd(  ) function cleans different SQL-dangerous values,while the htmlentities(  ) function cleans things like &#8220;&lt;&#8221; or &#8220;&gt;&#8221; (HTML Entities). The use of the Clean(  ) function:</span></p>
<pre><span style="font-style: normal;">
<pre>
<blockquote><address><span style="font-style: normal;">$check = array(</span></address>
<address><span style="white-space: pre;"><span style="font-style: normal;">	</span></span><span style="font-style: normal;">'_ENV',</span></address>
<address><span style="white-space: pre;"><span style="font-style: normal;">	</span></span><span style="font-style: normal;">'_GET',</span></address>
<address><span style="white-space: pre;"><span style="font-style: normal;">	</span></span><span style="font-style: normal;">'_POST',</span></address>
<address><span style="white-space: pre;"><span style="font-style: normal;">	</span></span><span style="font-style: normal;">'_FILES',</span></address>
<address><span style="white-space: pre;"><span style="font-style: normal;">	</span></span><span style="font-style: normal;">'_COOKIE',</span></address>
<address><span style="white-space: pre;"><span style="font-style: normal;">	</span></span><span style="font-style: normal;">'_REQUEST',</span></address>
<address><span style="white-space: pre;"><span style="font-style: normal;">	</span></span><span style="font-style: normal;">'_SESSION'</span></address>
<address><span style="font-style: normal;">);</span></address>
<address><span style="font-style: normal;">
</span></address>
<address><span style="font-style: normal;">foreach( $check as $key =&gt; $elm )</span></address>
<address><span style="font-style: normal;">{</span></address>
<address><span style="white-space: pre;"><span style="font-style: normal;">	</span></span><span style="font-style: normal;">${$key} = Clean( ${$key});</span></address>
<address><span style="font-style: normal;">}</span></address>
</blockquote>
</pre>
<p></span><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif; line-height: 19px; white-space: normal; font-size: 13px;">This example will clean all inputs to DB friendly values! This also cleans out things like &lt;script&gt; or &lt;a&gt; that could possibly lead to dangerous outputs.</span></pre>
<p><span style="font-family: Georgia, 'Times New Roman', 'Bitstream Charter', Times, serif;"><span style="line-height: 19px; white-space: normal;"><em>Up Next: </em><strong>PHP Security: Part 2 &#8211; Protecting vulnerable files</strong></span></span></p>
]]></content:encoded>
			<wfw:commentRss>http://zanehooper.com/blog/php-security-part-1-sql-injections.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Tutorial: Internet Explorer (IE) iframe</title>
		<link>http://zanehooper.com/blog/web-tutorial-internet-explorer-ie-iframe.html</link>
		<comments>http://zanehooper.com/blog/web-tutorial-internet-explorer-ie-iframe.html#comments</comments>
		<pubDate>Tue, 06 Jul 2010 15:33:55 +0000</pubDate>
		<dc:creator>Zane Hooper</dc:creator>
				<category><![CDATA[Web Tutorials]]></category>

		<guid isPermaLink="false">http://zanehooper.com/?p=17</guid>
		<description><![CDATA[I recently ran into a problem while trying to add an iframe with a transparent background in IE. CSS didn't seem to apply to the iframe when I was working with it (at least not very well). What we'll be fixing:

Allowing a background to be set with CSS or a transparent background
Removing borders from around the iframe (they look like crap)]]></description>
			<content:encoded><![CDATA[<p>I recently ran into a problem while trying to add an iframe with a transparent background in IE. CSS didn&#8217;t seem to apply to the iframe when I was working with it (at least not very well). What we&#8217;ll be fixing:</p>
<ol>
<li>Allowing a background to be set with CSS or a transparent background</li>
<li>Removing borders from around the iframe (they look like crap)</li>
</ol>
<p><strong>The Background</strong></p>
<p><strong> </strong>In Internet Explorer, if you try to add a background (or have a transparent background) with your page&#8217;s CSS it doesn&#8217;t work. Instead, it keeps a white, boring background from the iframe (assuming the iframe has no background set). This little code will fix this problem, allowing transparent or colored backgrounds to be set through CSS.</p>
<p>Inside of your &lt;body&gt; tag in the HTML of the iframe, set the background style to &#8220;inherit&#8221; (&lt;body style=&#8221;background:inherit;&#8221;&gt;) and you can have a background using CSS from <em>your</em> page. It&#8217;s that simple.</p>
<p><span style="text-decoration: underline;"><em>Note:</em></span><em> If you are making a transparent background, you need to add allowtransparency=&#8221;true&#8221; to the &lt;iframe&gt; tag as one of its attributes.</em></p>
<p><span style="text-decoration: underline;"><em>Note:</em></span><em> If you want to make this iframe of a page that you cannot edit, look into using PHP to modify the &lt;body&gt; tag.</em></p>
<p><strong>The Border</strong></p>
<p>This one is just as simple, and can be done straight from the HTML. Add to the &lt;iframe&gt;&#8217;s attributes the following: frameborder=&#8221;0&#8243;</p>
]]></content:encoded>
			<wfw:commentRss>http://zanehooper.com/blog/web-tutorial-internet-explorer-ie-iframe.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>WGCup</title>
		<link>http://zanehooper.com/blog/wgcup.html</link>
		<comments>http://zanehooper.com/blog/wgcup.html#comments</comments>
		<pubDate>Tue, 04 May 2010 02:19:59 +0000</pubDate>
		<dc:creator>Zane Hooper</dc:creator>
				<category><![CDATA[Jobs]]></category>

		<guid isPermaLink="false">http://zanehooper.com/?p=13</guid>
		<description><![CDATA[WGCup, or World Gaming Cup, is a league and tournament website based on the good parts of other successful leagues in an easy-to-use environment. Although not much other information can be released, WGCup is estimated to be launched early in June of 2010.]]></description>
			<content:encoded><![CDATA[<p><a title="World Gaming Cup" href="http://wgcup.com/" target="_blank">WGCup</a>, or World Gaming Cup, is a league and tournament website based on the good parts of other successful leagues in an easy-to-use environment. Although not much other information can be released, WGCup is estimated to be launched early in June of 2010.</p>
<p>My Jobs:</p>
<ul>
<li>Javascript/AJAX for an interactive front/back -end interface</li>
<li>PHP/MySQL for a secure but fast server</li>
<li>CSS/XHTML for a dazzling look</li>
</ul>
<p>Expect more updates on WGCup in the future.</p>
<p>Zane</p>
]]></content:encoded>
			<wfw:commentRss>http://zanehooper.com/blog/wgcup.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Welcome!</title>
		<link>http://zanehooper.com/blog/welcome.html</link>
		<comments>http://zanehooper.com/blog/welcome.html#comments</comments>
		<pubDate>Wed, 02 Sep 2009 02:17:28 +0000</pubDate>
		<dc:creator>Zane Hooper</dc:creator>
				<category><![CDATA[Jobs]]></category>

		<guid isPermaLink="false">http://zanehooper.com/?p=3</guid>
		<description><![CDATA[Just to update the web with what I've been working on lately (in order of priorities)]]></description>
			<content:encoded><![CDATA[<p>Well, just uploaded wordpress today so there could be a few errors.</p>
<ol></ol>
<p>I hope to install (or create) some good addons for WordPress pretty soon.</p>
<p>Zane</p>
]]></content:encoded>
			<wfw:commentRss>http://zanehooper.com/blog/welcome.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

