<?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>Edge of the Web &#187; development</title>
	<atom:link href="http://www.edgeoftheweb.co.uk/blog/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.edgeoftheweb.co.uk/blog</link>
	<description></description>
	<lastBuildDate>Tue, 03 Jan 2012 15:10:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Back to normal</title>
		<link>http://www.edgeoftheweb.co.uk/blog/2012/01/03/back-to-normal/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=back-to-normal</link>
		<comments>http://www.edgeoftheweb.co.uk/blog/2012/01/03/back-to-normal/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 12:06:04 +0000</pubDate>
		<dc:creator>thomas</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[random]]></category>
		<category><![CDATA[back to normal]]></category>

		<guid isPermaLink="false">http://www.edgeoftheweb.co.uk/blog/?p=1123</guid>
		<description><![CDATA[If it is normal for you to seek out new opportunities and ways to make your business (or your career/life better), then “back to normal” may be actually quite exciting.]]></description>
			<content:encoded><![CDATA[<div id="attachment_1124" class="wp-caption alignright" style="width: 310px"><a href="http://www.edgeoftheweb.co.uk/blog/wp-content/uploads/2012/01/time-for-a-change.jpg"><img class="size-medium wp-image-1124" title="time-for-a-change" src="http://www.edgeoftheweb.co.uk/blog/wp-content/uploads/2012/01/time-for-a-change-300x300.jpg" alt="back to normal" width="300" height="300" /></a><p class="wp-caption-text">Does your nose tell you it&#39;s time for a change?</p></div>
<p>This morning I was walking along the High St, and overheard somebody in front of me say ”everything is back to normal again now.”</p>
<p>I presume he meant that now all of the excitement and escapism of Christmas and New Year are over, we go back to the drudgery of our daily lives.</p>
<p>If I am brutally honest, his sentence did resonate with me a little. Only a little, but enough that I knew precisely what he was talking about.</p>
<p>Of course, it doesn’t help that today is wet and outrageously windy (so much so that I woke up to discover my fence had blown down, the felt has blown off my shed roof, and about 20% of the contents of the skip in my front garden were decorating my street&#8230;I’ll be popular when I get home tonight)</p>
<p>So what does back to normal mean, and why is there such a negative connotation attached to it?</p>
<p>I think it means that there are too many people out there that will spend tomorrow doing precisely what they do today and wishing they weren’t. I think it means that too many of us have the next year already mapped out before us, and whilst we don’t know what subtle variations will occur along the way, we do know fundamentally that unless a large helping of good or bad luck seeks us out, not a lot will change.</p>
<p>So how does that relate to a blog on a web design company&#8217;s website?</p>
<p>I suppose this post is just to say that I feel grateful that we get to work on creative projects, with ambitious, forward thinking clients. Our clients don’t just stand still and let life or business simply run it’s course. They are trying to ensure that tomorrow isn’t the same as today, it’s better.</p>
<p>It’s also to say that my business partner, Mark, and I spend every Tuesday night working solely on the development of Edge of the Web. We are just too busy to consider doing it during a working week, but we spend around 5 hours each Tuesday working out how to find new customers, improve our service levels, make our (excellent) staff happy, increase our margins, develop our image, understand where we want our business to be and so on. Every week, we are 10 hours of thinking and planning further ahead then we were last week.</p>
<p>Why not allocate a fixed time to try this for your own business weekly / monthly and see how you feel next year when it comes to “back to normal” time.</p>
<p>If it is normal for you to seek out new opportunities and ways to make your business (or your career/life better), then “back to normal” may be actually quite exciting.</p>
<p>With that said, I am not looking forward to the task of getting my garden back to normal tonight.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edgeoftheweb.co.uk/blog/2012/01/03/back-to-normal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Email migration strategy &#8211; plans &amp; tips</title>
		<link>http://www.edgeoftheweb.co.uk/blog/2011/11/08/email-migration-strategy-plans-tips/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=email-migration-strategy-plans-tips</link>
		<comments>http://www.edgeoftheweb.co.uk/blog/2011/11/08/email-migration-strategy-plans-tips/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 12:20:31 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[computing]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://www.edgeoftheweb.co.uk/blog/?p=964</guid>
		<description><![CDATA[Recently we moved our mail servers from where they’ve been hosted for a few years along with our website, to a shiny new cloud server, dedicated just for email (at the moment). Email is (still) the life-blood of 21st century &#8230;]]></description>
			<content:encoded><![CDATA[<div>
<p><a href="http://www.edgeoftheweb.co.uk/blog/wp-content/uploads/2011/11/shutterstock_59270638.jpg"><img class="alignright size-medium wp-image-969" style="padding-left: 20px;" title="Flying Emails" src="http://www.edgeoftheweb.co.uk/blog/wp-content/uploads/2011/11/shutterstock_59270638-300x212.jpg" alt="" width="300" height="212" /></a>Recently we moved our mail servers from where they’ve been hosted for a few years along with our website, to a shiny new cloud server, dedicated just for email (at the moment).</p>
<p>Email is (still) the life-blood of 21st century communication, despite the rise and fall of varying social mediums. Varying reports put the <a href="http://www.radicati.com/wp/wp-content/uploads/2010/04/Email-Statistics-Report-2010-2014-Executive-Summary2.pdf">total number of emails sent per year</a> in the 100s of billions, although there is some debate on just how much of that is spam!</p>
<p>So it was important that the transfer went smoothly, with as little disruption as possible. I followed advice from this useful <a href="http://www.toao.net/438-seamless-email-server-migration">email migration</a> guide to help with the transfer.<br />
To speed up DNS propagation, remember to change your TTL to something small, but don’t forget that your TTL must propagate too!</p>
<p>First, I setup the new server with mail and smtp server software and created all the relevant mailboxes and forwarders. Importantly I set up a PTR record for the server so reverse DNS lookups would match the mail server name properly.<br />
I used the same mail server software we were using on the old setup, so we didn’t have to worry about compatibility issues when moving emails across to the new system.</p>
<p>Secondly I setup a subdomain (e.g. tempmail.edgeoftheweb.co.uk) on the new server and created forwarders for all the accounts from that subdomain to our actual domain: e.g. info@tempmail.edgeoftheweb.co.uk pointed to info@edgeoftheweb.co.uk</p>
<p>Thirdly, once the DNS records for tempmail.edgeoftheweb.co.uk had propagated round the internet, I backed up all existing emails (including the subscribed folders list and email ID list) on the old server, and moved them to the new server. What I didn’t do at this point, but what I should have done, was to create all the existing IMAP folders (using <a href="http://bobpeers.com/technical/telnet_imap">telnet</a> for example).</p>
<p>Fourth, I setup forwarders on all the email accounts on the old system to redirect mail to tempmail.edgeoftheweb.co.uk. The clever thing was that when emails were received at the new server, it knew to redirect tempmail.edgeoftheweb.co.uk to edgeoftheweb.co.uk, but because it thought edgeoftheweb.co.uk was a locally stored domain name it just delivered incoming emails to essentially a different folder on the new server, rather than sending them back to the old one!</p>
<p>Fifth, I changed our DNS records to point our mail server at the new IP address, and also copied across any additional emails that had arrived since I backed the old server up from the old server to the new server.</p>
<p>Finally, once the DNS records had changed I re-configured our email clients to use the new SSL certificates for the new mail server and new account passwords too!</p>
<p>Having followed those steps we didn’t need to create or setup new email account in our mail clients, we didn’t loose any emails, and our mail clients remained synchronised with the mail server!</p>
<p>NB &#8211; to test the new mail server worked OK before DNS changes had been made, I added an entry to my <a href="http://en.wikipedia.org/wiki/Hosts_(file)">hosts file</a> redirecting our mail server domain name to the new server’s IP address.</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.edgeoftheweb.co.uk/blog/2011/11/08/email-migration-strategy-plans-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL PHP data processing &#8211; which is faster?</title>
		<link>http://www.edgeoftheweb.co.uk/blog/2010/12/16/mysql-php-processing/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=mysql-php-processing</link>
		<comments>http://www.edgeoftheweb.co.uk/blog/2010/12/16/mysql-php-processing/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 14:32:23 +0000</pubDate>
		<dc:creator>jon</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[data processing]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[develop]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.edgeoftheweb.co.uk/blog/?p=774</guid>
		<description><![CDATA[Many web developers aren't aware that the MySQL database language supports a number of useful function for data processing that are commonly overlooked and replaced with post-processing in PHP. For a recent project I decided to see how much I could achieve using a single MySQL query and as little post-processing with PHP.]]></description>
			<content:encoded><![CDATA[<p>Many web developers aren&#8217;t aware that the MySQL database language supports a number of <a title="MySQL Functions" href="http://dev.mysql.com/doc/refman/5.0/en/func-op-summary-ref.html">useful function for data processing</a> that are commonly overlooked and replaced with post-processing in PHP. For a recent project I decided to see how much I could achieve using a single MySQL query and as little post-processing with PHP.</p>
<p>There were two functions in particular that I made use of in my awesome query:</p>
<p>SUM() and IF()</p>
<p>These functions can be combined and used as a shortcut to provide statistical information without requiring PHP to do the data processing.</p>
<p>For example, in this scenario I needed to return the number of sales that day as well as the number of sales yesterday, and the total amount of money taken from those sales for both days. I could have just run two queries like this:</p>
<pre>SELECT * FROM orders WHERE DATE(date)=CURDATE();
SELECT * FROM orders WHERE DATE(date)=SUB_DATE(CURDATE(), INTERVAL 1 DAY);</pre>
<p>and then counted the number of returned rows using mysql_num_rows() in PHP and looped through those rows in order to add up the sales totals.</p>
<p>Instead, using a combination of SUM() and IF(), I did all the data processing within the MySQL query. This time I&#8217;ve selected sales from this month and last month:</p>
<pre>SELECT SUM(IF(MONTH(date)=MONTH(CURDATE()),price,0)) as "revenue_this_month",
<div style="padding-left: 50px;">SUM(IF(MONTH(date)&lt;&gt;MONTH(CURDATE()),price,0)) as "revenue_last_month",
SUM(MONTH(date)=MONTH(CURDATE())) as "sales_this_month",
SUM(MONTH(date)&lt;&gt;MONTH(CURDATE())) as "sales_last_month"
FROM orders
WHERE MONTH(date)&gt;=MONTH(CURDATE())-1;</div>
</pre>
<p>The way that this query works is by using the MONTH() function to return the month value from a date string e.g. MONTH(&#8220;2010-01-25 12:04:26&#8243;) would return &#8220;1&#8243;. This can then be used to limit orders by month.</p>
<p>The IF() function returns it&#8217;s 2nd argument if the 1st argument evaluates to TRUE, and its 3rd argument if it evaluates to FALSE. Which is brilliant, because we can then determine on which rows returned by the query that our SUM() function will increment. Additionally, as we can rename columns we can also give them useful column titles.</p>
<p>The alternative, as I mentioned above, would be to use PHP to process the data set returned by the following query:</p>
<pre>SELECT price, MONTH(date) as "month"
<div style="padding-left: 50px;">FROM orders WHERE
MONTH(date)&gt;=MONTH(CURDATE())-1;</div>
</pre>
<p>Just out of curiosity, I ran 50,000 tests on two different quad-core Windows 7 machines running a LAMP local server using the queries above on a database with randomly entered dates and prices and found these results on the performance difference:</p>
<table>
<thead>
<tr>
<th>Rows in Database</th>
<th>Rows Returned by Query</th>
<th>Number of times faster MySQL was than PHP</th>
</tr>
</thead>
<tbody>
<tr>
<td>117,000</td>
<td>19,136</td>
<td>13.90</td>
</tr>
<tr>
<td>58,500</td>
<td>9,530</td>
<td>13.63</td>
</tr>
</tbody>
</table>
<p>So, next time you&#8217;re creating summary reports using MySQL it might just be worth having a think to see if you can save yourself a lot of PHP processing by using some of the in-built power of MySQL.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edgeoftheweb.co.uk/blog/2010/12/16/mysql-php-processing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Aptana 3 PHP Support</title>
		<link>http://www.edgeoftheweb.co.uk/blog/2010/07/15/aptana-3-support/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=aptana-3-support</link>
		<comments>http://www.edgeoftheweb.co.uk/blog/2010/07/15/aptana-3-support/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 16:44:06 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.edgeoftheweb.co.uk/blog/?p=533</guid>
		<description><![CDATA[Aptana dropped PHP support for V2 in favour for PDT, but now it seems they have done a u-turn and are going to re-introduce it for v3. What will the features be like and will you be using it?]]></description>
			<content:encoded><![CDATA[<p>My previous blog post was all about the best PHP IDE and how our development team decided to switch from Aptana to Netbeans partly because of Aptanas decision to drop its PHP support in favour of PDT. However it seems that Aptana has since backtracked on this and is now re-introducing its own PHP support for Version 3.</p>
<p>So far they have confirmed the following as part of the Beta:<br />
1. Syntax coloring which is part of the new Studio themes support.<br />
2. Code Assist (for scripts in a single project and PHP API)<br />
3. Syntax Errors annotations (which are actually better then what we had in the old php plug in).<br />
4. Mark Occurrences<br />
5. A PHP &#8216;Ruble&#8217; (<a href="https://radrails.tenderapp.com/faqs/radrails-3/ruble-programming-guide">https://radrails.tenderapp.com/faqs/radrails-3/ruble-programming-guide</a>) that provides you the ability to add capabilities to the editor by scripting them at your own team (with some Rails knowledge).</p>
<p>They have also confirmed the following features for future releases:<br />
1. Code formatter<br />
2. Debugger support<br />
3. External libraries support<br />
4. More views, such as class hierarchy etc.<br />
5. Wizards and generators, such as class/interface wizards, Getters &amp; Setters etc.<br />
&#8230;And more</p>
<p>So it&#8217;s going to be interesting to see how Aptanas PHP shapes up in comparison to Netbeans and if this developer is going to be shifting back to Aptana.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edgeoftheweb.co.uk/blog/2010/07/15/aptana-3-support/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>What&#8217;s the best PHP IDE?</title>
		<link>http://www.edgeoftheweb.co.uk/blog/2010/03/30/php-ide/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=php-ide</link>
		<comments>http://www.edgeoftheweb.co.uk/blog/2010/03/30/php-ide/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 17:21:05 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.edgeoftheweb.co.uk/blog/?p=418</guid>
		<description><![CDATA[There are many an IDE on the market these days, some free and some not quite so free. So which is the best? Well having tried and tested quite a few, I have my personal favourite.]]></description>
			<content:encoded><![CDATA[<p><!-- 		@page { margin: 2cm } 		P { margin-bottom: 0.21cm } 		A:link { so-language: zxx } -->I&#8217;ve tried and tested many an IDE in my time, starting with <strong>Macromedia Dreamweaver 3</strong> many years ago. Dreamweaver served my needs brilliantly for quite a few years and I was in belief that I wouldn&#8217;t ever need another IDE, but as I started coding in <strong>PHP </strong>and moved to clean handcoded <strong>XHTML </strong>and <strong>CSS </strong>from table based layouts, I found Dreamweavers clumsiness just started to get in the way. I also found it slow over the network as all of my files were stored on our Linux testing server.</p>
<p>So the hunt for an alternative started. After a while digging around for a new IDE, I came across a neat little program called <strong>Aptana</strong>. Whilst it was still in heavy development, I was amazed how quick it was and how rich the PHP functionality was compared to Dreamweaver. I tried it out for a while and eventually ditched Dreamweaver and started using Aptana for all my web design and PHP coding.</p>
<p>I happily used Aptana for quite a while, but when they decided to ditch PHP support for version 2.0 in favour of <strong>Eclipse PDT</strong> and concentrate more on Ruby development, I was forced to start my search again. The PDT functionality was not a patch on Aptanas PHP support, so I was (as were many Aptana users) rather disappointed with Aptanas decision to do this.</p>
<p>Anyway, so began the search for a new IDE which supported PHP. I tried all sorts from <strong>NuSphere </strong>to <strong>Zend </strong>but eventually came across <strong>Netbeans</strong>. Although PHP support was in its infancy, I was impressed with the functionality in Netbeans and it had far fewer bugs than Aptana 1.5. So I installed, started using it and I&#8217;m happy to say that our entire team are now using Netbeans for our PHP and web development. Its PHP functionality is improving all the time, has good support for CSS, JavaScript and HTML. There is the ability to upload your projects via FTP and SFTP and best of all, it&#8217;s FREE!</p>
<p><strong>So if you&#8217;re looking at changing your IDE, I would recommend giving <a href="http://www.netbeans.org/" target="_blank">Netbeans </a>a try.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.edgeoftheweb.co.uk/blog/2010/03/30/php-ide/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Merge multiple PDF files in PHP using shell_exec() and Ghostscript</title>
		<link>http://www.edgeoftheweb.co.uk/blog/2010/02/19/merge-multiple-pdf-files-in-php-using-shell_exec-and-ghostscript/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=merge-multiple-pdf-files-in-php-using-shell_exec-and-ghostscript</link>
		<comments>http://www.edgeoftheweb.co.uk/blog/2010/02/19/merge-multiple-pdf-files-in-php-using-shell_exec-and-ghostscript/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 10:34:28 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.edgeoftheweb.co.uk/blog/?p=368</guid>
		<description><![CDATA[A quick tip on how to merge multiple PDF files together using PHP.]]></description>
			<content:encoded><![CDATA[<p>I had a problem earlier in the week where I needed to merge multiple PDF files together so they could be printed in one long run. I thought it was going to be one of those tasks that caused me to have a serious headache, but to my surprise it was rather easy.</p>
<p>Lets say you have 5 PDF files named &#8220;doc_1.pdf, doc_2.pdf, doc_3.pdf, doc_4.pdf and doc_5.pdf&#8221; and you need them to be merged into one file called &#8220;docs_joined.pdf&#8221;. All you have to do is use the following function:</p>
<p>shell_exec();</p>
<p>This function executes a command via shell and in this case the Linux command you want to call is &#8216;gs&#8217;, which is Ghostscript, a PostScript and PDF language interpreter and previewer.</p>
<p>So using both shell_exec() and &#8216;gs&#8217; we would do the following to join the PDFs together:</p>
<p>$output = shell_exec(&#8216;gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=docs_joined.pdf doc_1.pdf doc_2.pdf doc_3.pdf doc_4.pdf doc_5.pdf);</p>
<p>And you&#8217;re done. Simple!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edgeoftheweb.co.uk/blog/2010/02/19/merge-multiple-pdf-files-in-php-using-shell_exec-and-ghostscript/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Always encrypt Passwords in a database</title>
		<link>http://www.edgeoftheweb.co.uk/blog/2010/01/15/always-encrypt-passwords-in-a-database/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=always-encrypt-passwords-in-a-database</link>
		<comments>http://www.edgeoftheweb.co.uk/blog/2010/01/15/always-encrypt-passwords-in-a-database/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 17:17:40 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[credentials]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[encryption]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[sha1]]></category>
		<category><![CDATA[sign-up]]></category>

		<guid isPermaLink="false">http://www.edgeoftheweb.co.uk/blog/?p=267</guid>
		<description><![CDATA[As a web developer I obviously, well, hopefully have a good idea on how most websites fundamentaly work. One thing that always worries me though is when I am signing up for a new account on a website and have to enter a password.]]></description>
			<content:encoded><![CDATA[<p>As a web developer I obviously, well, hopefully have a good idea on how most websites fundamentaly work. One thing that always worries me though is when I am signing up for a new account on a website and have to enter a password. Now most of us would have a few or probably just one password that we use when signing up to accounts on-line. This obviously means that we don&#8217;t have to remember loads of different passwords, but what worries me is how these passwords are being stored.</p>
<p>When I was a junior developer, just learning to code websites with the facility to sign-up and login to accounts, I would simply store the information entered by the user in a database. So if someone entered the password &#8220;jimmy&#8221; I would store it in the database as &#8220;jimmy&#8221;. Now obviously there are limited people who have access to this information, but it is actually quite powerful information to own. This information could be used malicously if in the wrong hands. Take the following as an example:</p>
<p>You sign up for a Facebook using the following credentials:</p>
<p>Username: mark@myemailaddress.com<br />
Password: mypassword</p>
<p>You then also sign-up for an account with &#8216;my-made-up-website.com&#8217; (this is an example) using the same credentials. Now if &#8216;my-made-up-website.com&#8217; are storing your username and password as plain text in the database, anybody who has access to the database will be able to see these credentials. They would then have a pretty good idea that you could have used the same log-in credentials for Facebook. Hummm imagine what havoc they could cause on your Facebook page hey or even Amazon account with your saved credit card details?</p>
<p>So&#8230;now that I&#8217;m a much more experienced programmer, what do I do differently? Well as a minimum I encrypt any passwords being entered into the database. For this I use the following PHP function:</p>
<p>sha1();</p>
<p>So to encrypt the password &#8216;mypassword&#8217; we would apply the following before adding it to the database:</p>
<p>$password = sha1(&#8216;mypassword&#8217;);</p>
<p>This encryption is non-reversible so people who have access to the database wouldn&#8217;t be able to use it. There are methods out there to reverse this encryption, but it certainly isn&#8217;t easy.</p>
<p>You could also go a step further and add a &#8216;Salt&#8217; keyword to the password and also run it through sha1() twice, making it a double encryption and this should make it very very very very difficult to reverse. The method for this is as follows:</p>
<p>$salt = &#8216;shake-it-up&#8217;;</p>
<p>$password = sha1($salt . sha1($clean['password']) . $salt);</p>
<p>So adding the &#8216;Salt&#8217; keyword  means the hacker would not only have to guess that you have added that to the start and end of the password, but also that you have ran it through sha1() twice. They would also have to guess the &#8216;Salt&#8217; word used.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edgeoftheweb.co.uk/blog/2010/01/15/always-encrypt-passwords-in-a-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>containing website widths</title>
		<link>http://www.edgeoftheweb.co.uk/blog/2009/11/24/containing-website-widths/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=containing-website-widths</link>
		<comments>http://www.edgeoftheweb.co.uk/blog/2009/11/24/containing-website-widths/#comments</comments>
		<pubDate>Tue, 24 Nov 2009 17:53:08 +0000</pubDate>
		<dc:creator>bhups</dc:creator>
				<category><![CDATA[development]]></category>
		<category><![CDATA[fixed layout]]></category>
		<category><![CDATA[fluid layout]]></category>
		<category><![CDATA[website width]]></category>

		<guid isPermaLink="false">http://www.edgeoftheweb.co.uk/blog/?p=192</guid>
		<description><![CDATA[With wide screens becoming ever more popular, so does the importance of assigning a width to websites. If you're thinking of having your website expand to fit the width of the user's screen, you may want to think again.]]></description>
			<content:encoded><![CDATA[<p>With wide screens becoming ever more popular, so does the importance of assigning a width to websites. If you&#8217;re thinking of having your website expand to fit the width of the user&#8217;s screen, you may want to think again.</p>
<p>This won&#8217;t only be an ugly website to look at on certain screens, but can you imagine reading text on a widescreen monitor? Chances are you&#8217;ll get lost before finishing the line you&#8217;re on, and if you do manage to get halfway through a paragraph you&#8217;ll probably feel the need to claw your eyeballs out.</p>
<p>A safe max-width to work at for your website is 1000px, this should cater for the people whose monitors have a resolution of 1024px wide. The remaining 24px will come in use for the scroll bar that may appear on the right-hand side of the the browser.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edgeoftheweb.co.uk/blog/2009/11/24/containing-website-widths/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Page expired PHP problems</title>
		<link>http://www.edgeoftheweb.co.uk/blog/2009/11/11/page-expired-php-problems/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=page-expired-php-problems</link>
		<comments>http://www.edgeoftheweb.co.uk/blog/2009/11/11/page-expired-php-problems/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 15:16:20 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.edgeoftheweb.co.uk/blog/?p=180</guid>
		<description><![CDATA[Page Expired messages generated by browsers after a form submission is a very annoying yet common problem facing all PHP developers. A simple solution is to use the header() function once the form has been submitted.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been recently developing a very large scale website and back end system for a client and during the development process we came across and very annoying yet common issue that really spoils the user experience. When data is posted from one page to another and the user navigates back using the &#8220;Back&#8221; button in their browser, you get a warning page saying that the page has expired. Not only is this very annoying for the user, but could potentially turn them off from using the site altogether.</p>
<p>So what&#8217;s the solution? Well there are a couple of things we can do to help the problem, but the only real way to get around this is to use a header redirect once the form has been posted. Let&#8217;s look at an example.</p>
<p>So you have a form like below and you want the users name to be stored in a session variable.</p>
<p>&lt;form action=&#8221;step_2.php&#8221; method=&#8221;post&#8221;&gt;<br />
&lt;input type=&#8221;text&#8221; id=&#8221;users_name&#8221; name=&#8221;users_name&#8221; /&gt;<br />
&lt;input type=&#8221;submit&#8221; id=&#8221;submit&#8221; name=&#8221;submit&#8221; value=&#8221;SUBMIT&#8221; /&gt;<br />
&lt;/form&gt;</p>
<p>When the SUBMIT button is then pressed a PHP script is called to store the users_name in a SESSION variable, like so:</p>
<p>&lt;?php<br />
if (isset($_POST['users_name'])) {<br />
$_SESSION['users_name'] = $_POST['users_name'];<br />
}<br />
?&gt;</p>
<p>The one thing that is missing from this script is the header redirect. This will redirect the page to the page of your choice and will eliminate the Page Expired issue. So to do this simply change the above script to:</p>
<p>&lt;?php<br />
if (isset($_POST['users_name'])) {<br />
$_SESSION['users_name'] = $_POST['users_name'];<br />
header(&#8216;Location: step_2.php&#8217;);<br />
}<br />
?&gt;</p>
<p>Perfect!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edgeoftheweb.co.uk/blog/2009/11/11/page-expired-php-problems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clearing Floats &#8211; A Better Solution</title>
		<link>http://www.edgeoftheweb.co.uk/blog/2009/10/30/clearing-floats-a-better-solution/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=clearing-floats-a-better-solution</link>
		<comments>http://www.edgeoftheweb.co.uk/blog/2009/10/30/clearing-floats-a-better-solution/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 16:26:59 +0000</pubDate>
		<dc:creator>mark</dc:creator>
				<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.edgeoftheweb.co.uk/blog/?p=166</guid>
		<description><![CDATA[A better solution to the "clear: all" problem facing all web designers who use a double floating layout.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m sure all web designers have come across a really annoying problem with multiple  &lt;div&gt; columns that float.</p>
<p><strong>The Problem:</strong></p>
<p>If you have a 2 column layout and one &lt;div&gt; has &#8220;float: left;&#8221; and the other &#8220;float: right;&#8221;, the containing &lt;div&gt; tag is not going to expand beyond those 2 floating &lt;div&gt; tags. The old solution was to put a new &lt;div&gt; tag under those columns, with the CSS rule of &#8220;clear: all&#8221;. So you would end up with the following code:</p>
<p>&lt;div id=&#8221;container&#8221;&gt;</p>
<p>&lt;div id=&#8221;column_left&#8221;&gt;Content&lt;/div&gt;</p>
<p>&lt;div id=&#8221;column_right&#8221;&gt;Content&lt;/div&gt;</p>
<p>&lt;div class=&#8221;float_clear&#8221;&gt;&lt;/div&gt;</p>
<p>&lt;/div&gt;</p>
<p>#container {<br />
border: 1px solid #000000;<br />
}</p>
<p>#column_left {<br />
float: left;<br />
}</p>
<p>#column_right {<br />
float: right;<br />
}</p>
<p>.float_clear {<br />
clear: both;<br />
}</p>
<p>Although this works just fine and dandy, the main issue with it is that it creates extra unwanted HTML markup. Well the good news is that a better solution has since emerged. Instead of using the float_clear tag, replace your #container CSS with the following:</p>
<p>#container {<br />
border: 1px solid #000000;<br />
overflow: auto;<br />
width: 100%<br />
}</p>
<p>This results in the same outcome as using the &lt;div class=&#8221;float_clear&#8221;&gt;&lt;/div&gt; markup and clear: both; CSS.</p>
<p>Brilliant!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.edgeoftheweb.co.uk/blog/2009/10/30/clearing-floats-a-better-solution/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

