<?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>Utter Randomness &#187; Web Design</title>
	<atom:link href="http://matt-shaffer.com/blog/category/web/feed/" rel="self" type="application/rss+xml" />
	<link>http://matt-shaffer.com/blog</link>
	<description></description>
	<lastBuildDate>Wed, 10 Feb 2010 01:57:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Why I Love my Host</title>
		<link>http://matt-shaffer.com/blog/2009/03/31/why-i-love-my-host/</link>
		<comments>http://matt-shaffer.com/blog/2009/03/31/why-i-love-my-host/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 02:30:31 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[host]]></category>

		<guid isPermaLink="false">http://matt-shaffer.com/blog/?p=114</guid>
		<description><![CDATA[<br/>I just felt like sharing my love of my host. My current host is RapidVPS, and I have been with them for 5 months. Now, I&#8217;m sure at least one reader of this post will be thinking &#8220;But I&#8217;m on this awesome free host&#8221;, good for you.
Here&#8217;s my experience with free hosts:

Limited and slow support
Resellers. [...]]]></description>
			<content:encoded><![CDATA[<br/><p>I just felt like sharing my love of my host. My current host is <a href="http://rapidvps.com">RapidVPS</a>, and I have been with them for 5 months. Now, I&#8217;m sure at least one reader of this post will be thinking &#8220;But I&#8217;m on this awesome free host&#8221;, good for you.</p>
<p>Here&#8217;s my experience with free hosts:</p>
<ul>
<li>Limited and slow support</li>
<li>Resellers. They offer others&#8217; resources to you</li>
<li>Quickly close down</li>
<li>Don&#8217;t offer many things needed to run a modern website (MySQL/FTP)</li>
<li>Slow</li>
<li>Attacked and abused frequently</li>
<li>Overselling. They offer more than they can give (Used to entice people, and it works)</li>
</ul>
<p>I&#8217;ve probably been hosted at a dozen different free hosts so far, and that&#8217;s generally how it goes. So what makes RVPS so great for me?</p>
<ol>
<li>Monthly payments. None of that crap where they show you the price for a 3 years advance payment. In fact, they don&#8217;t even offer whole year sales (But actually, at the time of writing, they&#8217;re trying to fill up some shared hosting space so they are, but they&#8217;re still keeping the monthly payment an option!). I don&#8217;t want to pay for a year + at a time. What if something happens at that host? I don&#8217;t want to have wasted hundreds of dollars paying for all that surplus hosting when the host turns out to be a flop and I want to move.</li>
<li>Fast servers. Oh yeah, paid hosting is a ton faster than free hosting, even on a shared plan.</li>
<li>Features. Pretty much everything I could ever ask for. MySQL (unlimited), web based email, auto responders, unlimited domains, PHP, server status page, and a whole lot more.</li>
<li>Support. While hosted at RVPS, I&#8217;ve only had to contact the staff 3 times and I&#8217;ll explain a bit more because you probably think that shouldn&#8217;t have to be done on a paid host. Firstly, all 3 support tickets were answered within **1** hour. Of course that&#8217;s not going to happen all of the time. Now the first ticket I sent was because they had an error on their account registration page. Their script let me enter an invalid domain name, which broke my account. This one took the longest at an hour for a response, and when I did receive a reply, my account was fixed and active and their registration page had been fixed. The second time I contacted support was for an old MySQL version (4). One of the staff graciously moved me off to a new server &#8212; seemlessly &#8212; that had MySQL 5. The third time I contacted them, it was because the server was undergoing massive stress. The load was up at 80, and a normal load for that server was usually 1 or less. 80 times the norm really took it&#8217;s toll, but the server still tried to deliver pages (and would, sometimes after minutes). I contacted the staff and got a response within 5 minutes, the load halved in 10 minutes, and the load back to normal in 20 minutes. Their support is truly lengendary IMO.</li>
<li>Not oversold! That means they offer each account what they can handle. While this may be a turn off because of a relatively low amount of bandwidth, it adds up to better performance.</li>
<li>Their account system is epic. I mean, really epic. With 1 set of login info, I can manage accounts across different servers with their own unique hosting plans. If I want to say, have a website running on a dedicated server and also have a backup server hosted at RVPS, I can simply login and restart both within a few clicks, or restart 1 and change the login details of the other. It&#8217;s super easy, but I have yet to actually purchase two simultaneous packages.</li>
<li>Acc System #2. Their account system also allows for you to seemlessly upgrade and downgrade to nearly any hosting package. You can go from shared hosting to a level 2 VPS without any site downtime.</li>
<li>What! They own their equipment, they don&#8217;t rent it out. They buy datacenter rackspace and have people working physically with the servers. Rick, owner of RVPS, even posts pictures of himself, other staff, and the servers. Rick is proud of what he does and rightly so. I don&#8217;t know of any other host (so far) that is willing to post pictures of themselves and their setup.</li>
</ol>
<p>I&#8217;m currently on the lowest level shared hosting plan and have loved it since the day I first got it. While I&#8217;ve seen plenty of other hosts that are super cheap (some at $3 offering TBs of transfer); I chose and have stuck with RVPS. I know someone hosted at that cheapo shared hosting site and the minute he got a spike in traffic his account was suspended, then when his site was attacked they wanted to kill his account permanently. It was only by a loophole in their TOS that he was able to keep his account hosted there. That&#8217;s not the kind of company I want to be hosted with.</p>
<p>So, when finding a paid host, look for reviews, forums (easiest for others to voice their opinions and concerns), and check them out more. Took me a few weeks to decide on RVPS, but once I saw the intelligence, confidence, and overall joy Rick took in his job, I knew this was the host for me. I also loved that he owned the servers and thus had physical access, as well as him posting pictures that I could view before registering on the forums or buying a hosting package.</p>
]]></content:encoded>
			<wfw:commentRss>http://matt-shaffer.com/blog/2009/03/31/why-i-love-my-host/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Manage your template/layout easier</title>
		<link>http://matt-shaffer.com/blog/2009/02/06/manage-your-templatelayout-easier/</link>
		<comments>http://matt-shaffer.com/blog/2009/02/06/manage-your-templatelayout-easier/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 04:07:33 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[template]]></category>

		<guid isPermaLink="false">http://matt-shaffer.com/?p=104</guid>
		<description><![CDATA[<br/>Stop torchering yourself. I&#8217;ve done this too many times, and I think it&#8217;s time to shed a little light into the web design world. Do you have experience with php? If you do, I heavily suggest  you create a system similar to mine.
The gist: You have a php include file with a bunch of functions [...]]]></description>
			<content:encoded><![CDATA[<br/><p>Stop torchering yourself. I&#8217;ve done this too many times, and I think it&#8217;s time to shed a little light into the web design world. Do you have experience with php? If you do, I heavily suggest  you create a system similar to mine.</p>
<p>The gist: You have a php include file with a bunch of functions to echo content. Then, once you&#8217;ve created a template php file with all of the functions in the correct places echoing the correct stuff, create the site.</p>
<p><strong>Why? </strong>Let&#8217;s say you find a template you like, or just make a mistake in your custom edited template php/html file. Now, it turns out that 8 hours later you discover that you made a mistake and you&#8217;ll have to redo all of those dozens of pages. Or maybe you&#8217;re like me and just want to keep adding navigation links left and right &#8211; then remembering that you&#8217;ll have to redit and reupload every single file.</p>
<p>You get the idea. Here&#8217;s what one of my sites looks like:</p>

<div class="wp_codebox"><table width="100%" ><tr id="p1043"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
</pre></td><td class="code" id="p104code3"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;page.php&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>link href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;main.css&quot;</span> rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;stylesheet&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/css&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> logo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;wrap&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> menu<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;container&quot;</span><span style="color: #339933;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> sidebar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;mainbox&quot;</span><span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text&quot;</span><span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;midbar&quot;</span><span style="color: #339933;">&gt;</span>
				<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;midbartxt&quot;</span><span style="color: #339933;">&gt;</span>
					Text
				<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;midbaritm&quot;</span><span style="color: #339933;">&gt;</span>
				<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text&quot;</span><span style="color: #339933;">&gt;</span>
					Some text
				<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
			<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
		<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
<span style="color: #000000; font-weight: bold;">&lt;?php</span> footer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>You can see how this is working, right? Well here&#8217;s what the page.php file looks like anyway</p>

<div class="wp_codebox"><table width="100%" ><tr id="p1044"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
</pre></td><td class="code" id="p104code4"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> logo<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000ff;">'&lt;div id=&quot;logo&quot;&gt;Logo&lt;/div&gt;'</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> menu<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000cc; font-style: italic;">&lt;&lt;&lt;EOF
&lt;div id=&quot;menu&quot;&gt;
 &lt;div id=&quot;link&quot;&gt;Hello
 &lt;div id=&quot;link&quot;&gt;Hello again
&lt;/div&gt;
EOF</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> sidebar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000cc; font-style: italic;">&lt;&lt;&lt;EOF
&lt;div id=&quot;sidebar&quot;&gt;
		&lt;div id=&quot;text&quot;&gt;
		Ello
		&lt;/div&gt;
&lt;/div&gt;
EOF</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> footer<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<a href="http://www.php.net/echo"><span style="color: #990000;">echo</span></a> <span style="color: #0000cc; font-style: italic;">&lt;&lt;&lt;EOF
&lt;div id=&quot;copy&quot;&gt;&amp;copy; their respective owners.&lt;/div&gt;
EOF</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Seeing the potential benefits yet? Yes? Then go spread the word and implement something like this yourself. It is such a headache to manually edit every single page all over again just to add another navigation link. Just edit page.php or something similar and have the changes appear across all pages.</p>
<p>- You&#8217;re welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://matt-shaffer.com/blog/2009/02/06/manage-your-templatelayout-easier/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Changing Phpbb3&#8217;s Captcha</title>
		<link>http://matt-shaffer.com/blog/2009/02/05/changing-phpbb3s-captcha/</link>
		<comments>http://matt-shaffer.com/blog/2009/02/05/changing-phpbb3s-captcha/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 02:54:40 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[forum]]></category>
		<category><![CDATA[phpbb]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://matt-shaffer.com/?p=99</guid>
		<description><![CDATA[<br/>As mentioned in a previous post, I&#8217;m being spammed and hard. Phpbb3&#8217;s captcha has been broken, and I needed a fix. With phpbb.com down due to unrelated problems, I set off to create my own captcha.
In this post, I will walk you through the steps of modifying the captcha to display a math problem (addition). [...]]]></description>
			<content:encoded><![CDATA[<br/><p>As mentioned in a previous post, I&#8217;m being spammed and hard. Phpbb3&#8217;s captcha has been broken, and I needed a fix. With phpbb.com down due to unrelated problems, I set off to create my own captcha.</p>
<p>In this post, I will walk you through the steps of modifying the captcha to display a math problem (addition). If you have the brains/guts, you can easily modify this to make it more secure, do subtraction, and make the text harder to read by bots &#8211; but the fact is, this is currently a unique system. There&#8217;s no need to change the text to anything fancy at the moment.</p>
<p>Where do we start? The most obvious is to decide your target areas.<br />
<strong>Backup all files before proceeding.</strong></p>
<p><strong>Changing the captcha in guest chat sections</strong><br />
All of the changes we&#8217;ll be doing in this section center around <strong>posting.php</strong>, which is in the root directory.</p>
<p>Let&#8217;s start off by changing the line that displays the captcha image.<br />
Find this line:</p>

<div class="wp_codebox"><table width="100%" ><tr id="p9913"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p99code13"><pre class="php" style="font-family:monospace;"><span style="color: #0000ff;">'CONFIRM_IMAGE'</span>				<span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;img src=&quot;'</span> <span style="color: #339933;">.</span> append_sid<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;<span style="color: #006699; font-weight: bold;">{$phpbb_root_path}</span>ucp.<span style="color: #006699; font-weight: bold;">$phpEx</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'mode=confirm&amp;amp;id='</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$confirm_id</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&amp;amp;type='</span> <span style="color: #339933;">.</span> CONFIRM_POST<span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'&quot; alt=&quot;&quot; title=&quot;&quot; /&gt;'</span><span style="color: #339933;">,</span></pre></td></tr></table></div>

<p>And change it to this:</p>

<div class="wp_codebox"><table width="100%" ><tr id="p9914"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p99code14"><pre class="php" style="font-family:monospace;"><span style="color: #0000ff;">'CONFIRM_IMAGE'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;img src=&quot;'</span><span style="color: #339933;">.</span><span style="color: #000088;">$phpbb_root_path</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'conf.'</span><span style="color: #339933;">.</span><span style="color: #000088;">$phpEx</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'?s1='</span><span style="color: #339933;">.</span><span style="color: #000088;">$seed</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&amp;s2='</span><span style="color: #339933;">.</span><span style="color: #000088;">$seed2</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'&quot;&gt;'</span><span style="color: #339933;">,</span></pre></td></tr></table></div>

<p>Because we&#8217;re not using the default captcha anymore, go ahead and delete the following lines:</p>

<div class="wp_codebox"><table width="100%" ><tr id="p9915"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p99code15"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$seed</span> <span style="color: #339933;">-=</span> <span style="color: #208080;">0x7fffffff</span> <span style="color: #339933;">*</span> <a href="http://www.php.net/floor"><span style="color: #990000;">floor</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$seed</span> <span style="color: #339933;">/</span> <span style="color: #208080;">0x7fffffff</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Alrighty, now we want to generate 2 random numbers between 1 and 5 for the user to add together, so he can easily do it without being annoyed.</p>
<p>Find this line:</p>

<div class="wp_codebox"><table width="100%" ><tr id="p9916"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p99code16"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$seed</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/hexdec"><span style="color: #990000;">hexdec</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/substr"><span style="color: #990000;">substr</span></a><span style="color: #009900;">&#40;</span>unique_id<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>and change it to</p>

<div class="wp_codebox"><table width="100%" ><tr id="p9917"><td class="line_numbers"><pre>1
</pre></td><td class="code" id="p99code17"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$seed</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/rand"><span style="color: #990000;">rand</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>And after that line, add the following two lines:</p>

<div class="wp_codebox"><table width="100%" ><tr id="p9918"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p99code18"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$seed2</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/rand"><span style="color: #990000;">rand</span></a><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$seed3</span><span style="color: #339933;">=</span><span style="color: #000088;">$seed</span><span style="color: #339933;">+</span><span style="color: #000088;">$seed2</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Now scroll down a bit until you find the $sql variable. Change the code and seed lines to these:</p>

<div class="wp_codebox"><table width="100%" ><tr id="p9919"><td class="line_numbers"><pre>1
2
</pre></td><td class="code" id="p99code19"><pre class="php" style="font-family:monospace;"><span style="color: #0000ff;">'code'</span>			<span style="color: #339933;">=&gt;</span> <span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$seed3</span><span style="color: #339933;">,</span>
<span style="color: #0000ff;">'seed'</span>			<span style="color: #339933;">=&gt;</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$seed3</span><span style="color: #009900;">&#41;</span></pre></td></tr></table></div>

<p>Now we have the SUM of $seed and $seed2 stored in the database in the spot previously held by phpbb&#8217;s captcha. This is so we don&#8217;t have to muck  around changing the database. (Note here: If it doesn&#8217;t work you may need to go in with phpmyadmin and change the confirm table to be unsigned).</p>
<p>What do we have so far? We have the sum of two values stored in a database, and the captcha image changed to a custom value. The form should also be able to check if the value is correct without further changes.</p>
<p><strong>The captcha generator</strong><br />
Create a new file and name it conf.php. Paste this into the file:</p>

<div class="wp_codebox"><table width="100%" ><tr id="p9920"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code" id="p99code20"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #000088;">$img</span> <span style="color: #339933;">=</span> imagecreate<span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">250</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">32</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$background_color</span> <span style="color: #339933;">=</span> imagecolorallocate<span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">222</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">190</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">148</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$black</span> <span style="color: #339933;">=</span> imagecolorallocate<span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$str</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'s1'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'s2'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$str</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot; Error. Please refresh page.&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;">$str</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;What is &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'s1'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot; + &quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$_REQUEST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'s2'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;?&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
	<span style="color: #666666; font-style: italic;">// 12 is font</span>
	imagestring<span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">12</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><span style="color: #000088;">$str</span><span style="color: #339933;">,</span><span style="color: #000088;">$black</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<a href="http://www.php.net/header"><span style="color: #990000;">header</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-type: image/gif'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	imagegif<span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	imagedestroy<span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>This will take 2 get parameters and simple say &#8220;What is X + Y&#8221;. Save this file into your root install folder, where posting.php is. Change the $background_color to your own preferences; currently it is a tannish color to fit into the theme of my site.</p>
<p>Now just upload the files to your server (remember: backup if you haven&#8217;t already), and hopefully all will be working well.</p>
<p>Live PHP image creation demo: http://kingoflands.com/forum/conf.php?s1=Phpbb&#038;s2=Captcha</p>
<p>If you have any problems, post a comment. I created this captcha system yesterday and I&#8217;m hoping I included everything I did in it.</p>
<p>- Adding this to the registration page is yet to be added.</p>
]]></content:encoded>
			<wfw:commentRss>http://matt-shaffer.com/blog/2009/02/05/changing-phpbb3s-captcha/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Phpbb3 captcha solved by bots -&gt; Spam problem</title>
		<link>http://matt-shaffer.com/blog/2009/02/05/phpbb3-captcha-solved-by-bots-spam-problem/</link>
		<comments>http://matt-shaffer.com/blog/2009/02/05/phpbb3-captcha-solved-by-bots-spam-problem/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 20:28:56 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[forum]]></category>
		<category><![CDATA[phpbb]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://matt-shaffer.com/?p=96</guid>
		<description><![CDATA[<br/>Over the last week, me and many others with phpbb3 forums have been pounded with spam. Same old, trying to sell meds. This is occurring on the registration page and guest chat sections. For registration, they simply put a link to their drug selling site in their profile and never post. In the guest chat [...]]]></description>
			<content:encoded><![CDATA[<br/><p>Over the last week, me and many others with phpbb3 forums have been pounded with spam. Same old, trying to sell meds. This is occurring on the registration page and guest chat sections. For registration, they simply put a link to their drug selling site in their profile and never post. In the guest chat section, they write out spam posts.</p>
<p>What&#8217;s causing this? A cracked (able to be solved by bots) captcha. Being the geek that I am, I changed the captcha system to something completely different &#8211; and the spam dropped dead. I haven&#8217;t yet put the new captcha on the registration page, and surprise surprise, I&#8217;m still getting spam registrations. This is almost definitely a bot.</p>
<p>Voice your thoughts on this, want a solution? I may give some starting points if I get comments requesting an example. Otherwise, just try out google.</p>
]]></content:encoded>
			<wfw:commentRss>http://matt-shaffer.com/blog/2009/02/05/phpbb3-captcha-solved-by-bots-spam-problem/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>CSS: Vertically align text to the right of an image</title>
		<link>http://matt-shaffer.com/blog/2009/01/14/css-vertically-align-text-to-the-right-of-an-image/</link>
		<comments>http://matt-shaffer.com/blog/2009/01/14/css-vertically-align-text-to-the-right-of-an-image/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 01:22:24 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[vertical align]]></category>

		<guid isPermaLink="false">http://matt-shaffer.com/?p=77</guid>
		<description><![CDATA[<br/>Basically, you have an image with text that is vertically aligned to the right of the image. I never found a solution on the internet, and this is what I came up with in my spare time poking around:

1
2
3
4
&#60;div&#62;
&#60;div style=&#34;float: left;&#34;&#62;&#60;img src=&#34;./apple.png&#34; alt=&#34;&#34; /&#62;&#60;/div&#62;
&#60;div style=&#34;text-align: left; line-height: 42px;&#34;&#62;right text&#60;/div&#62;
&#60;/div&#62;

Short and sweet. It does not auto [...]]]></description>
			<content:encoded><![CDATA[<br/><p>Basically, you have an image with text that is vertically aligned to the right of the image. I never found a solution on the internet, and this is what I came up with in my spare time poking around:</p>

<div class="wp_codebox"><table width="100%" ><tr id="p7722"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p77code22"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;float: left;&quot;</span>&gt;&lt;<a href="http://december.com/html/4/element/img.html"><span style="color: #000000; font-weight: bold;">img</span></a> <span style="color: #000066;">src</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;./apple.png&quot;</span> <span style="color: #000066;">alt</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #66cc66;">/</span>&gt;&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>
<span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">style</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text-align: left; line-height: 42px;&quot;</span>&gt;</span>right text<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span>
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></pre></td></tr></table></div>

<p>Short and sweet. It does not auto adjust to the image; so you&#8217;ll have to change line-height to your liking. This is similar to wordwrapping, but not quite.</p>
<p>Finished example:</p>
<p><img class="alignnone size-full wp-image-81" title="Vert aligned text" src="http://matt-shaffer.com/blog/wp-content/uploads/2009/01/tmp.png" alt="Vert aligned text" width="116" height="54" /></p>
]]></content:encoded>
			<wfw:commentRss>http://matt-shaffer.com/blog/2009/01/14/css-vertically-align-text-to-the-right-of-an-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding a webhost</title>
		<link>http://matt-shaffer.com/blog/2008/12/31/finding-a-webhost/</link>
		<comments>http://matt-shaffer.com/blog/2008/12/31/finding-a-webhost/#comments</comments>
		<pubDate>Wed, 31 Dec 2008 05:46:35 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[host]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://matt-shaffer.com/?p=48</guid>
		<description><![CDATA[<br/>Finding a fast, reliable webhost can be quite a challenge &#8211; especially if you don&#8217;t want to spend any money. If you just want to host a blog or a forum, then search google &#8211; there&#8217;s plenty of free services out there that allow you to do that easily. However, if you want to build [...]]]></description>
			<content:encoded><![CDATA[<br/><p>Finding a fast, reliable webhost can be quite a challenge &#8211; especially if you don&#8217;t want to spend any money. If you just want to host a blog or a forum, then search google &#8211; there&#8217;s plenty of free services out there that allow you to do that easily. However, if you want to build your own site or control every aspect you&#8217;ll want to find a webhost.</p>
<p>Here&#8217;s some basic tips</p>
<ul>
<li>Check the age of the supposed &#8220;company&#8221;. Nowadays, the hosting market has become very saturated and reselling has become popular.</li>
<li>Don&#8217;t fall for &#8220;overselling&#8221;. This is when a host will offer you absurd amounts of bandwidth and space at no cost. These high numbers are just there to attract you &#8211; and it works.</li>
<li>Check for forums. Many hosts are starting to create forums for their users to chat on. Check the number of users and activity and use it as a potential guide.</li>
<li>Look for reviews on the internet. This one is very important &#8211; other users will post their experiences, good and bad, about the host. A word of warning though: Quite a few hosts have been caught paying people to write good reviews for them. If the host is truly bad, the number of bad reviews will still clearly outshine the good.</li>
<li>Try to find their uptime stats. You wouldn&#8217;t want to find out that your host that claimed 98% uptime has less than 80%.</li>
<li>Look at their features. For a free host, mysql/sendmail/fsockopen and a few others can easily lead to abuse and are often not available on free hosts. If you absolutely need these, make sure you check if the host offers it before signing up.</li>
<li>Read their TOS. This can be a very important one &#8211; if you want to host a proxy site, that generally won&#8217;t happen on free or paid hosting due to the CPU intensity of these sites. Also it is important because some hosts don&#8217;t want to host games or photo galleries, which may be what you want to create. Save your time, effort, and possibly money by at least skimming through the TOS. On top of that, remember when I mentioned overselling earlier? Well, this becomes key in their TOS. Often, it will say that the hundreds of GBs of bandwidth they offer you must not exceed ___% bandwidth for files that aren&#8217;t text based like html/php. If you want to host some images/software etc, this can be critical.</li>
</ul>
<p>Good luck in your searches!</p>
]]></content:encoded>
			<wfw:commentRss>http://matt-shaffer.com/blog/2008/12/31/finding-a-webhost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blocking an IP with .htaccess</title>
		<link>http://matt-shaffer.com/blog/2008/12/22/blocking-an-ip-with-htaccess/</link>
		<comments>http://matt-shaffer.com/blog/2008/12/22/blocking-an-ip-with-htaccess/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 04:06:12 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[ban]]></category>
		<category><![CDATA[block ip]]></category>
		<category><![CDATA[htaccess]]></category>

		<guid isPermaLink="false">http://matt-shaffer.com/?p=29</guid>
		<description><![CDATA[<br/>This was sad, utterly sad. The first comment to this blog was a SPAM comment. I hate spam, so I&#8217;m going to add a few lines to my .htaccess file to prevent that IP from coming back and spamming me again.
What can you do with .htaccess banning?
1. Ban an IP
2. Ban an IP range (100.100.100.xxx), [...]]]></description>
			<content:encoded><![CDATA[<br/><p>This was sad, utterly sad. The first comment to this blog was a SPAM comment. I hate spam, so I&#8217;m going to add a few lines to my .htaccess file to prevent that IP from coming back and spamming me again.</p>
<p>What can you do with .htaccess banning?<br />
1. Ban an IP<br />
2. Ban an IP range (100.100.100.xxx), where xxx can be anything and will still be blocked<br />
3. Ban a domain name. Ex: proxy1.c0oproxeh.com, proxy2.c0oproxeh.com will both be unable to view the site</p>
<p>Let&#8217;s get started. Here&#8217;s how you can block a single IP<br />
<code><br />
order allow,deny<br />
deny from 100.100.100.1<br />
allow from all <br />
</code><br />
Just switch out &#8220;100.100.100.1&#8243; with the IP you want to block. That was pretty easy, wasn&#8217;t it? Now on to multiple IPs.<br />
<code><br />
order allow,deny<br />
deny from 100.100.100.1<br />
deny from 100.100.100.2<br />
deny from 100.100.100.3<br />
deny from 100.100.100.4<br />
deny from 100.100.100.5<br />
allow from all<br />
</code><br />
Now there are some tricky spammers out there who own multiple IPs with only slight variations. The most common way to attempt to prevent these spammers is to block every IP that has the first 3 sections the same (100.100.100). This is called IP range banning<br />
<code><br />
order allow,deny<br />
deny from 100.100.100<br />
allow from all<br />
</code><br />
Note that the above code will block 100.100.100.1, 100.100.100.2 ETC.</p>
<p>Last thing: Blocking a domain name (Like .com, .net etc)<br />
<code><br />
order allow,deny<br />
deny from c0oproxeh.com<br />
allow from all<br />
</code></p>
<p>Final note: You can mix and match all of these! Here&#8217;s an example<br />
<code><br />
order allow,deny<br />
deny from c0oproxeh.com<br />
deny from 100.100.100<br />
deny from 200.200.200.2<br />
allow from all<br />
</code></p>
<p>There ya go! Not hard at all. Just remember: Many hosts, mostly free hosts, will block custom .htaccess files.</p>
]]></content:encoded>
			<wfw:commentRss>http://matt-shaffer.com/blog/2008/12/22/blocking-an-ip-with-htaccess/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.Htaccess and Error Pages</title>
		<link>http://matt-shaffer.com/blog/2008/12/21/htaccess-and-error-pages/</link>
		<comments>http://matt-shaffer.com/blog/2008/12/21/htaccess-and-error-pages/#comments</comments>
		<pubDate>Sun, 21 Dec 2008 19:11:55 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://matt-shaffer.com/?p=22</guid>
		<description><![CDATA[<br/>You&#8217;re probably familiar with any major company having a nice, custom page when you land on a page that no longer exists. In this post, I will describe how you can add your own custom error pages with htaccess (assuming you are the webmaster).
First off, here are some common error codes and what they mean:
400: [...]]]></description>
			<content:encoded><![CDATA[<br/><p>You&#8217;re probably familiar with any major company having a nice, custom page when you land on a page that no longer exists. In this post, I will describe how you can add your own custom error pages with htaccess (assuming you are the webmaster).</p>
<p>First off, here are some common error codes and what they mean:</p>
<p>400: Bad Request<br />
401: Authorization required<br />
403: Forbidden<br />
404: Page not found<br />
500: Server error</p>
<p>Now, those might not mean much to you, but the most common error page and one that you should set is 404. If you so much as rename a file, visitors may be coming from google and the file doesn&#8217;t exist. Instead of seeing a bland white page (or your host&#8217;s 404 page), you should change it.<br />
Here&#8217;s a sample .htaccess file<br />
<code><br />
ErrorDocument 404 /404.html<br />
ErrorDocument 500 /500.html<br />
ErrorDocument 400 /400.html<br />
ErrorDocument 401 /401.html<br />
ErrorDocument 403 /403.html<br />
</code><br />
You don&#8217;t have to name the file to match the error number, you can name the 404 error page &#8220;GoodbyeWorld.html&#8221; if you wanted.</p>
<p>Now: Some tips for creating this file. On Windows, you cannot easily create this file. It doesn&#8217;t like having only extensions for filenames. To solve this problem, simply create your file and name it htaccess or htaccess.txt. Then, upload it to your web server and from there you can change its name (from ftp or a control panel).</p>
<p>The most common problem people may face is due to their hosts: Many hosts, more specifically, many free hosts do not allow you to have a custom .htaccess file.</p>
]]></content:encoded>
			<wfw:commentRss>http://matt-shaffer.com/blog/2008/12/21/htaccess-and-error-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
