<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Leon&#039;s NED24 Blog</title>
	<atom:link href="http://leonsned24blog.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://leonsned24blog.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Sun, 30 Aug 2009 12:57:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='leonsned24blog.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Leon&#039;s NED24 Blog</title>
		<link>http://leonsned24blog.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://leonsned24blog.wordpress.com/osd.xml" title="Leon&#039;s NED24 Blog" />
	<atom:link rel='hub' href='http://leonsned24blog.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Final &#8211; Conclusion</title>
		<link>http://leonsned24blog.wordpress.com/2009/08/30/final-conclusion/</link>
		<comments>http://leonsned24blog.wordpress.com/2009/08/30/final-conclusion/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 12:50:38 +0000</pubDate>
		<dc:creator>Leon</dc:creator>
				<category><![CDATA[Finished Website]]></category>

		<guid isPermaLink="false">http://leonsned24blog.wordpress.com/?p=312</guid>
		<description><![CDATA[After the pagination, I tidied up the site with a bit more style, and fixed any errors in the code, like missing end tags. I found it quite difficult to validate the pages, as a number of different variations were possible, due to the &#8216;includes&#8217; files and login area. Eventually I got there though and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=312&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After the pagination, I tidied up the site with a bit more style, and fixed any errors in the code, like missing end tags. I found it quite difficult to validate the pages, as a number of different variations were possible, due to the &#8216;includes&#8217; files and login area. Eventually I got there though and everything was tidied and validated just fine.</p>
<p>I purposely asked a lot of myself with my original design document, as I wanted a challenge, and have enjoyed trying to achieve all I set out to do. I ran out of time on a few features, namely the &#8216;remember me&#8217; and &#8216;forgotten password&#8217; functions, but these were always going to be bonus  options. I did manage to read up a little on how to achieve these features, so I will try them out at a later date.</p>
<p>I also managed to add a few features that i had not planned, like the offensive words check and the change password page, so overall I feel I did a good job of meeting my expectations.</p>
<p>Given the chance again, I would have used a template for the style, or updated a current site, but I still managed to make the site look good and sit nicely, and I believe for this task, the functionality is more important than the look.</p>
<p>I have enjoyed the challenge of this task greatly, and now look forward to using my learned knowledge in the real world, as I have just been given a job of creating a site that features, among other things, a members login area!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leonsned24blog.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leonsned24blog.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leonsned24blog.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leonsned24blog.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/leonsned24blog.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/leonsned24blog.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/leonsned24blog.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/leonsned24blog.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leonsned24blog.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leonsned24blog.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leonsned24blog.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leonsned24blog.wordpress.com/312/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leonsned24blog.wordpress.com/312/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leonsned24blog.wordpress.com/312/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=312&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://leonsned24blog.wordpress.com/2009/08/30/final-conclusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8014cfa983d540b0e561915945c32d69?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">leonjonharris</media:title>
		</media:content>
	</item>
		<item>
		<title>Pagination!!!</title>
		<link>http://leonsned24blog.wordpress.com/2009/08/30/pagination/</link>
		<comments>http://leonsned24blog.wordpress.com/2009/08/30/pagination/#comments</comments>
		<pubDate>Sun, 30 Aug 2009 12:20:29 +0000</pubDate>
		<dc:creator>Leon</dc:creator>
				<category><![CDATA[Finished Website]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://leonsned24blog.wordpress.com/?p=308</guid>
		<description><![CDATA[It was finally time to add pagination to query results, so only a fixed number of listings would be shown on each page. I first looked at a tutorial I found online (PHPMySQLTutorial 2008). This looked good but, to be honest, some of the calculations went straight over my head!! I finally ended up following [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=308&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It was finally time to add pagination to query results, so only a fixed number of listings would be shown on each page. I first looked at a tutorial I found online (PHPMySQLTutorial 2008). This looked good but, to be honest, some of the calculations went straight over my head!!</p>
<p>I finally ended up following the technique used in the Ullman book (Ullman 2008). It took a bit of fiddling to shoehorn it into my site, as I added it to the display_listings function, so I used PHP_SELF for the links, for example, but eventually I got it all working nicely. The calculations take a bit to get your head around (or at least mine did), but taking it step by step, it all made sense in the end.</p>
<p>Later, I also added pagination to the &#8216;favourites&#8217; page.</p>
<p> PHPMySQLTutorial. 2008. <em>Paging Using PHP.</em><a href="http://www.php-mysql-tutorial.com/wikis/php-tutorial/paging-using-php.aspx">http://www.php-mysql-tutorial.com/wikis/php-tutorial/paging-using-php.aspx</a> (accessed August 30, 2009).</p>
<p>Ullman, L. 2008. <em>Common Programming Techniques (Paginating Query Results Section).</em> In PHP 6 and MySQL 5, 277-284. Berkeley: Peachpit Press.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leonsned24blog.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leonsned24blog.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leonsned24blog.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leonsned24blog.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/leonsned24blog.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/leonsned24blog.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/leonsned24blog.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/leonsned24blog.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leonsned24blog.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leonsned24blog.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leonsned24blog.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leonsned24blog.wordpress.com/308/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leonsned24blog.wordpress.com/308/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leonsned24blog.wordpress.com/308/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=308&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://leonsned24blog.wordpress.com/2009/08/30/pagination/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8014cfa983d540b0e561915945c32d69?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">leonjonharris</media:title>
		</media:content>
	</item>
		<item>
		<title>Edit Reviews</title>
		<link>http://leonsned24blog.wordpress.com/2009/08/28/edit-reviews/</link>
		<comments>http://leonsned24blog.wordpress.com/2009/08/28/edit-reviews/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 11:32:43 +0000</pubDate>
		<dc:creator>Leon</dc:creator>
				<category><![CDATA[Finished Website]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://leonsned24blog.wordpress.com/?p=291</guid>
		<description><![CDATA[I also added functionality to allow the user to update any reviews they had submitted. This used similar techniques to the update details page. The big difference was I had to append the product id to the link from the &#8216;My Reviews&#8217; page as follows. This was so the new page knew which review to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=291&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I also added functionality to allow the user to update any reviews they had submitted. This used similar techniques to the update details page. The big difference was I had to append the product id to the link from the &#8216;My Reviews&#8217; page as follows.</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/update3.jpg?w=450&#038;h=14" alt="update3" title="update3" width="450" height="14" class="alignnone size-full wp-image-305" /></p>
<p>This was so the new page knew which review to display in the form. While testing this page, I realised I had made a small error in my clean() function for checking offensive words. I realised that because I had the &#8216;if&#8217; error message outside the while loop, the loop would continue regardless of whether it found an error or not. This meant that an error would only be returned if the last offensive word in the db  was found.</p>
<p>To fix this, I just had to move the &#8216;if&#8217; clause inside the &#8216;while&#8217; loop, and add a &#8216;break&#8217; as soon as an error was found.</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/clean.jpg?w=446&#038;h=130" alt="clean" title="clean" width="446" height="130" class="alignnone size-full wp-image-306" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leonsned24blog.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leonsned24blog.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leonsned24blog.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leonsned24blog.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/leonsned24blog.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/leonsned24blog.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/leonsned24blog.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/leonsned24blog.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leonsned24blog.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leonsned24blog.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leonsned24blog.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leonsned24blog.wordpress.com/291/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leonsned24blog.wordpress.com/291/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leonsned24blog.wordpress.com/291/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=291&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://leonsned24blog.wordpress.com/2009/08/28/edit-reviews/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8014cfa983d540b0e561915945c32d69?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">leonjonharris</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/update3.jpg" medium="image">
			<media:title type="html">update3</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/clean.jpg" medium="image">
			<media:title type="html">clean</media:title>
		</media:content>
	</item>
		<item>
		<title>Change Password</title>
		<link>http://leonsned24blog.wordpress.com/2009/08/28/change-password/</link>
		<comments>http://leonsned24blog.wordpress.com/2009/08/28/change-password/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 11:31:58 +0000</pubDate>
		<dc:creator>Leon</dc:creator>
				<category><![CDATA[Finished Website]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://leonsned24blog.wordpress.com/?p=289</guid>
		<description><![CDATA[I next added a page so the user could change their password. For this I looked at the Ullman book again (Ullman 2008), but I made a few additions. The example just had the user enter the new password twice, but I wanted the user to enter their current password as well for extra security. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=289&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I next added a page so the user could change their password. For this I looked at the Ullman book again (Ullman 2008), but I made a few additions.</p>
<p>The example just had the user enter the new password twice, but I wanted the user to enter their current password as well for extra security.</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/pass1.jpg?w=328&#038;h=482" alt="pass1" title="pass1" width="328" height="482" class="alignnone size-full wp-image-300" /></p>
<p>I then checked that the current password matched the user id in the db before proceeding</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/pass2.jpg?w=450&#038;h=46" alt="pass2" title="pass2" width="450" height="46" class="alignnone size-full wp-image-301" /></p>
<p>Then I would update the db when all was validated, and check a change had been made by using the  mysql_affected_rows function</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/pass3.jpg?w=450&#038;h=173" alt="pass3" title="pass3" width="450" height="173" class="alignnone size-full wp-image-302" /></p>
<p>Ullman, L. 2008. <em>Example &#8211; User Registration (Password Management Section).</em> In PHP6 and MySQL5, 524-528. Berkeley: Peachpit Press.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leonsned24blog.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leonsned24blog.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leonsned24blog.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leonsned24blog.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/leonsned24blog.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/leonsned24blog.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/leonsned24blog.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/leonsned24blog.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leonsned24blog.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leonsned24blog.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leonsned24blog.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leonsned24blog.wordpress.com/289/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leonsned24blog.wordpress.com/289/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leonsned24blog.wordpress.com/289/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=289&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://leonsned24blog.wordpress.com/2009/08/28/change-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8014cfa983d540b0e561915945c32d69?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">leonjonharris</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/pass1.jpg" medium="image">
			<media:title type="html">pass1</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/pass2.jpg" medium="image">
			<media:title type="html">pass2</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/pass3.jpg" medium="image">
			<media:title type="html">pass3</media:title>
		</media:content>
	</item>
		<item>
		<title>Edit User Details</title>
		<link>http://leonsned24blog.wordpress.com/2009/08/27/edit-user-details/</link>
		<comments>http://leonsned24blog.wordpress.com/2009/08/27/edit-user-details/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 14:06:28 +0000</pubDate>
		<dc:creator>Leon</dc:creator>
				<category><![CDATA[Finished Website]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://leonsned24blog.wordpress.com/2009/08/27/edit-user-details/</guid>
		<description><![CDATA[I added a new link from the &#8216;My Details&#8217; page to give the user the option of editing their details. This uses a lot of the techniques I had previously learnt, plus a few new ones. The first was a change to the validation, so when the username was checked against the db to make [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=288&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I added a new link from the &#8216;My Details&#8217; page to give the user the option of editing their details. This uses a lot of the techniques I had previously learnt, plus a few new ones. The first was a change to the validation, so when the username was checked against the db to make sure it was unique, a new query had to be added to only check usernames for other users, not themselves.</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/update1.jpg?w=450&#038;h=38" alt="update1" title="update1" width="450" height="38" class="alignnone size-full wp-image-296" /></p>
<p>After the form validated, I then updated all the users details, regardless of whether the details had changed or not. Both these techniques where picked up from the Ullman book (Ullman 2008)</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/update2.jpg?w=450&#038;h=30" alt="update2" title="update2" width="450" height="30" class="alignnone size-full wp-image-297" /></p>
<p>Ullman, L. 2008. <em>Common Programming Techniques (Editing Existing Records Section).</em> In PHP 6 and MySQL 5, 274. Berkeley: Peachpit Press.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leonsned24blog.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leonsned24blog.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leonsned24blog.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leonsned24blog.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/leonsned24blog.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/leonsned24blog.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/leonsned24blog.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/leonsned24blog.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leonsned24blog.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leonsned24blog.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leonsned24blog.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leonsned24blog.wordpress.com/288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leonsned24blog.wordpress.com/288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leonsned24blog.wordpress.com/288/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=288&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://leonsned24blog.wordpress.com/2009/08/27/edit-user-details/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8014cfa983d540b0e561915945c32d69?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">leonjonharris</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/update1.jpg" medium="image">
			<media:title type="html">update1</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/update2.jpg" medium="image">
			<media:title type="html">update2</media:title>
		</media:content>
	</item>
		<item>
		<title>&#8216;You are Here&#8217;</title>
		<link>http://leonsned24blog.wordpress.com/2009/08/27/you-are-here/</link>
		<comments>http://leonsned24blog.wordpress.com/2009/08/27/you-are-here/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 08:36:18 +0000</pubDate>
		<dc:creator>Leon</dc:creator>
				<category><![CDATA[Finished Website]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://leonsned24blog.wordpress.com/?p=284</guid>
		<description><![CDATA[I wanted to &#8216;unlink&#8217; and highlight the current page in the navigation. As the nav was included along with the header, I had to use PHP to do this, which was suprisingly simple in the end. I took the technique from an &#8216;A List Apart&#8217; article (Pearce 2003), but I had to modify it slightly, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=284&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I wanted to &#8216;unlink&#8217; and highlight the current page in the navigation. As the nav was included along with the header, I had to use PHP to do this, which was suprisingly simple in the end. I took the technique from an &#8216;A List Apart&#8217; article (Pearce 2003), but I had to modify it slightly, as the one on this site still linked the current page.</p>
<p>All I did to achieve this was to put the &#8216;currentpage&#8217; id in an if clause, as the ALA article did, but then placed the link in an else clause, so it only became a link if not the current page. I already had the page title in a variable, so I just used this again to check for a match with the navigation.</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/code_youarehere.jpg?w=450&#038;h=106" alt="code_youarehere" title="code_youarehere" width="450" height="106" class="alignnone size-full wp-image-285" /></p>
<p>So now the current page is unlinked and will be highlighted when I get round to adding style!</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/youarehere.jpg?w=450&#038;h=299" alt="youarehere" title="youarehere" width="450" height="299" class="alignnone size-full wp-image-286" /></p>
<p> Pearce, J. 2003. <em>Keeping Navigation Current With PHP.</em><a href="http://www.alistapart.com/articles/keepingcurrent/">http://www.alistapart.com/articles/keepingcurrent/</a> (accessed August 27, 2009).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leonsned24blog.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leonsned24blog.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leonsned24blog.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leonsned24blog.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/leonsned24blog.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/leonsned24blog.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/leonsned24blog.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/leonsned24blog.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leonsned24blog.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leonsned24blog.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leonsned24blog.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leonsned24blog.wordpress.com/284/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leonsned24blog.wordpress.com/284/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leonsned24blog.wordpress.com/284/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=284&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://leonsned24blog.wordpress.com/2009/08/27/you-are-here/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8014cfa983d540b0e561915945c32d69?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">leonjonharris</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/code_youarehere.jpg" medium="image">
			<media:title type="html">code_youarehere</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/youarehere.jpg" medium="image">
			<media:title type="html">youarehere</media:title>
		</media:content>
	</item>
		<item>
		<title>To Do list &#8211; revisited</title>
		<link>http://leonsned24blog.wordpress.com/2009/08/27/to-do-list-revisited/</link>
		<comments>http://leonsned24blog.wordpress.com/2009/08/27/to-do-list-revisited/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 06:50:59 +0000</pubDate>
		<dc:creator>Leon</dc:creator>
				<category><![CDATA[Finished Website]]></category>

		<guid isPermaLink="false">http://leonsned24blog.wordpress.com/?p=281</guid>
		<description><![CDATA[Add ‘You are Here’ to left navigation Add a selection of top rated toys to the Home Page Add pagination to the listings Reviews – Add any customer reviews to product details page – Add ‘Submit Review’ form – Calculate average score for customer reviews Login – ‘Remember Me’ – ‘Forgotten Password?’ – Add option [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=281&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Add ‘You are Here’ to left navigation<br />
<del datetime="2009-08-27T06:47:13+00:00">Add a selection of top rated toys to the Home Page</del><br />
Add pagination to the listings<br />
<del datetime="2009-08-27T06:52:27+00:00">Reviews – Add any customer reviews to product details page<br />
– Add ‘Submit Review’ form<br />
– Calculate average score for customer reviews</del><br />
Login – ‘Remember Me’<br />
– ‘Forgotten Password?’<br />
– Add option for users to change their details<br />
Make the site look pretty</p>
<p>Still plenty to do. On we go&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leonsned24blog.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leonsned24blog.wordpress.com/281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leonsned24blog.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leonsned24blog.wordpress.com/281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/leonsned24blog.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/leonsned24blog.wordpress.com/281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/leonsned24blog.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/leonsned24blog.wordpress.com/281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leonsned24blog.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leonsned24blog.wordpress.com/281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leonsned24blog.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leonsned24blog.wordpress.com/281/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leonsned24blog.wordpress.com/281/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leonsned24blog.wordpress.com/281/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=281&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://leonsned24blog.wordpress.com/2009/08/27/to-do-list-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8014cfa983d540b0e561915945c32d69?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">leonjonharris</media:title>
		</media:content>
	</item>
		<item>
		<title>Customer Reviews Part 4 &#8211; Cleaning up the reviews!</title>
		<link>http://leonsned24blog.wordpress.com/2009/08/27/customer-reviews-part-4-cleaning-up-the-reviews/</link>
		<comments>http://leonsned24blog.wordpress.com/2009/08/27/customer-reviews-part-4-cleaning-up-the-reviews/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 05:17:18 +0000</pubDate>
		<dc:creator>Leon</dc:creator>
				<category><![CDATA[Finished Website]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://leonsned24blog.wordpress.com/?p=278</guid>
		<description><![CDATA[In the real world, I would probably have a system of the entered review being emailed to me to check and edit before adding them to the site, but for the purpose of this assignment, they are being added directly to the site. To make this a little bit more interesting, I decided to add [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=278&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In the real world, I would probably have a system of the entered review being emailed to me to check and edit before adding them to the site, but for the purpose of this assignment, they are being added directly to the site. To make this a little bit more interesting, I decided to add a block on certain words (ie swearwords), to the form validation.</p>
<p>I searched around, but most tutorials added a filter and replaced the words, like these &#8216;YouTube&#8217; videos that I found useful as a starting point (PHPAcademy 2009). I just wanted an error message to be displayed instead. I also decided that I would store the offensive words in a new table in the database to make adding new words simple. After much searching, I found this forum discussion that provided the inspiration for what I eventually did (CodingForums 2009).</p>
<p>It still used a replacement technique, but otherwise was what I was after. I decided to look up the php string functions to see if I could find a suitable one to use instead of replace. I found the answer at W3Schools (W3Schools 2009). stristr() would return a value if it found a matching pattern in some text, and is case insensitive, so it was perfect for the job.</p>
<p>So I created a function called clean() to check through the submitted string, and return an error message if it found anything offensive</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/code_swear.jpg?w=449&#038;h=160" alt="code_swear" title="code_swear" width="449" height="160" class="alignnone size-full wp-image-279" /></p>
<p>Now I just need to fill the db table with loads of offensive words!!</p>
<p> CodingForums. 2009. <em>Censoring messages through PHP</em> <a href="http://codingforums.com/showthread.php?t=171988">http://codingforums.com/showthread.php?t=171988</a> (accessed August 27, 2009).</p>
<p> PHPAcademy. 2009. <em>PHP Tutorials: Swear Word Filter (Part 1 &amp; 2) (YouTube videos).</em> <a href="http://www.youtube.com/watch?v=TUTbODM5JF4&amp;feature=related">http://www.youtube.com/watch?v=TUTbODM5JF4&amp;feature=related</a> (accessed August 27, 2009).</p>
<p> W3Schools. 2009. <em>PHP stristr() Function.</em><a> http://www.w3schools.com/PHP/func_string_stristr.asp</a> (accessed August 27, 2009).</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leonsned24blog.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leonsned24blog.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leonsned24blog.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leonsned24blog.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/leonsned24blog.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/leonsned24blog.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/leonsned24blog.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/leonsned24blog.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leonsned24blog.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leonsned24blog.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leonsned24blog.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leonsned24blog.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leonsned24blog.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leonsned24blog.wordpress.com/278/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=278&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://leonsned24blog.wordpress.com/2009/08/27/customer-reviews-part-4-cleaning-up-the-reviews/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8014cfa983d540b0e561915945c32d69?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">leonjonharris</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/code_swear.jpg" medium="image">
			<media:title type="html">code_swear</media:title>
		</media:content>
	</item>
		<item>
		<title>Customer Reviews Part 3 &#8211; Submit a Review</title>
		<link>http://leonsned24blog.wordpress.com/2009/08/26/customer-reviews-part-3-submit-a-review/</link>
		<comments>http://leonsned24blog.wordpress.com/2009/08/26/customer-reviews-part-3-submit-a-review/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 13:29:31 +0000</pubDate>
		<dc:creator>Leon</dc:creator>
				<category><![CDATA[Finished Website]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://leonsned24blog.wordpress.com/?p=266</guid>
		<description><![CDATA[It was finally time to add the functionality to submit a review! I started by adding a link to the product details. I used the technique of appending the id to the url as I learnt previously. I then set about creating the &#8216;submit review&#8217; page itself. It starts out similar to the &#8216;register&#8217; page [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=266&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It was finally time to add the functionality to submit a review! I started by adding a link to the product details. I used the technique of appending the id to the url as I learnt previously.</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/code_addid2.jpg?w=450&#038;h=32" alt="code_addid2" title="code_addid2" width="450" height="32" class="alignnone size-full wp-image-269" /></p>
<p>I then set about creating the &#8216;submit review&#8217; page itself. It starts out similar to the &#8216;register&#8217; page and uses the same validation technique from Ashwell (Ashwell 2008).</p>
<p>My first new addition was to add htmlentities() to the posted variables to help prevent XSS attacks (Ullman 2008l)</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/code_xss.jpg?w=433&#038;h=37" alt="code_xss" title="code_xss" width="433" height="37" class="alignnone size-full wp-image-276" /></p>
<p>We need to first check that the user has not already reviewed the selected product. This is done by performing a simple sql check, similar to the registration check on the username, that displayes a message and exits the script if a record is returned that matches the current user id and product id</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/code_reviewcheck.jpg?w=450&#038;h=145" alt="code_reviewcheck" title="code_reviewcheck" width="450" height="145" class="alignnone size-full wp-image-271" /></p>
<p>The form includes a pulldown menu for the &#8216;Rating&#8217; score. I first had to look up how to do this, as it was such a long time since I had done this!! (Castro 2006). For validation, I checked that the default &#8216;-Your Rating-&#8217; was not posted, meaning that a score had not been selected, and also confirmed that the selection was numeric, just in case.</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/code_dropcheck.jpg?w=449&#038;h=44" alt="code_dropcheck" title="code_dropcheck" width="449" height="44" class="alignnone size-full wp-image-273" /></p>
<p>As I had done previously, I wanted the error message to be displayed along with the form and inputted data, so I had to make the form &#8216;sticky&#8217; again. This was easy for the &#8216;Review Title&#8217;, but for the others I had to do a bit more research. I found how to make the pulldown menu sticky in the Ullman book (Ullman 2008k). This involves checking to see if the posted rating matches each option, and adding selected = &#8220;selected&#8221; if it does</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/code_dropsel.jpg?w=450&#038;h=60" alt="code_dropsel" title="code_dropsel" width="450" height="60" class="alignnone size-full wp-image-274" /></p>
<p>The Ullman book didn&#8217;t seem to cover making &#8216;sticky&#8217; textareas, But I found the solution on PHP Builder (PHPBuilder 2008). It turned out to be quite simple, just echo the entered text back into the textarea!</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/code_stickytextarea.jpg?w=450&#038;h=22" alt="code_stickytextarea" title="code_stickytextarea" width="450" height="22" class="alignnone size-full wp-image-275" /></p>
<p>Then once the data has all been validated, it gets written to the db as per &#8216;Research&#8217;. Done <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p> Ashwell, S. 2008. <em>PHP form validation basics.</em><a href="http://www.total-php.com/article/17/php-form-validation-basics/">http://www.total-php.com/article/17/php-form-validation-basics/</a> (accessed August 1, 2009).</p>
<p> Castro, E. 2006. <em>HTML, XHTML, and CSS, Sixth Edition (Visual Quickstart Guide)</em>: Peachpit Press.</p>
<p> PHPBuilder. 2008. <em>Making a textarea sticky.</em><a href="http://www.phpbuilder.com/board/showthread.php?t=10356687">http://www.phpbuilder.com/board/showthread.php?t=10356687</a> (accessed August 26, 2009).</p>
<p>Ullman, L. 2008k. <em>Example &#8211; E-Commerce (Page 550).</em> In PHP6 and MySQL, 550. Berkeley: Peachpit Press.</p>
<p>Ullman, L. 2008l. <em>Preventing XSS Attacks (in Security Methods).</em> In PHP 6 and MySQL 5, 374. Berkeley: Peachpit Press.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leonsned24blog.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leonsned24blog.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leonsned24blog.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leonsned24blog.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/leonsned24blog.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/leonsned24blog.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/leonsned24blog.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/leonsned24blog.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leonsned24blog.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leonsned24blog.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leonsned24blog.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leonsned24blog.wordpress.com/266/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leonsned24blog.wordpress.com/266/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leonsned24blog.wordpress.com/266/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=266&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://leonsned24blog.wordpress.com/2009/08/26/customer-reviews-part-3-submit-a-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8014cfa983d540b0e561915945c32d69?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">leonjonharris</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/code_addid2.jpg" medium="image">
			<media:title type="html">code_addid2</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/code_xss.jpg" medium="image">
			<media:title type="html">code_xss</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/code_reviewcheck.jpg" medium="image">
			<media:title type="html">code_reviewcheck</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/code_dropcheck.jpg" medium="image">
			<media:title type="html">code_dropcheck</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/code_dropsel.jpg" medium="image">
			<media:title type="html">code_dropsel</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/code_stickytextarea.jpg" medium="image">
			<media:title type="html">code_stickytextarea</media:title>
		</media:content>
	</item>
		<item>
		<title>&#8216;Our Favourites&#8217;</title>
		<link>http://leonsned24blog.wordpress.com/2009/08/23/our-favourites/</link>
		<comments>http://leonsned24blog.wordpress.com/2009/08/23/our-favourites/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 13:18:47 +0000</pubDate>
		<dc:creator>Leon</dc:creator>
				<category><![CDATA[Finished Website]]></category>
		<category><![CDATA[Research]]></category>

		<guid isPermaLink="false">http://leonsned24blog.wordpress.com/?p=242</guid>
		<description><![CDATA[I wanted the Home Page to include a couple of randomly selected products, just to keep the page fresh and interesting for each visit. These products should only be ones that had scored highly in our rating. I read up on the RAND() function in the Ullman book (Ullman 2008j). Reading this I realised I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=242&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I wanted the Home Page to include a couple of randomly selected products, just to keep the page fresh and interesting for each visit. These products should only be ones that had scored highly in our rating. I read up on the RAND() function in the Ullman book (Ullman 2008j). Reading this I realised I could order a query randomly, and limit the returned results, perfect for what I needed. This is the query I created</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/code_rand1.jpg?w=450&#038;h=47" alt="code_rand" title="code_rand" width="450" height="47" class="alignnone size-full wp-image-253" /></p>
<p>I limited the results to only include products with a rating of at least 9, and limited the return to just 2. So now if you load the Home Page you get something like this</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/rand11.jpg?w=436&#038;h=289" alt="rand1" title="rand1" width="436" height="289" class="alignnone size-full wp-image-252" /></p>
<p>And on reload, you may get something like this</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/rand22.jpg?w=444&#038;h=287" alt="rand2" title="rand2" width="444" height="287" class="alignnone size-full wp-image-258" /></p>
<p>Next, I wanted the user to be able to view all high rated products, so I created a link to a new &#8216;favourites&#8217; page. This used a similar query as the Home Page, but instead of the random order and limit, it is just ordered by rating.</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/code_favq.jpg?w=450&#038;h=45" alt="code_favq" title="code_favq" width="450" height="45" class="alignnone size-full wp-image-260" /></p>
<p>This worked fine, but when a user went into the product details from the favourites page, I wanted the breadcrumbs to list &#8216;favourites&#8217; rather than the products category. I originally thought of creating a session in the favourites page that if set would do the job. I got this working, but after some more thought, I decided to append the url instead, due to the problems I had previously with sessions.</p>
<p>So I added a new value to the url (Ullman 2008i) in the link</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/code_favget.jpg?w=344&#038;h=20" alt="code_favget" title="code_favget" width="344" height="20" class="alignnone size-full wp-image-261" /></p>
<p>and then added a clause to check for this value in the product detail page (Ullman 2008k), before the switch clause to display the breadcrumbs</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/code_favgetcheck.jpg?w=418&#038;h=130" alt="code_favgetcheck" title="code_favgetcheck" width="418" height="130" class="alignnone size-full wp-image-262" /></p>
<p>So now if a product is selected from the &#8216;Favourites&#8217; page, the breadcrumbs look like this</p>
<p><img src="http://leonsned24blog.files.wordpress.com/2009/08/bcfav.jpg?w=310&#038;h=28" alt="bcfav" title="bcfav" width="310" height="28" class="alignnone size-full wp-image-263" /></p>
<p>Ullman, L. 2008i. Common Programming Techniques (Sending Values to a Script Section). In PHP 6 and MySQL 5, 260-263. Berkeley: Peachpit Press.</p>
<p>Ullman, L. 2008j. Introduction to SQL &#8211; Numeric functions. In PHP 6 and MySQL 5, 150-151. Berkeley: Peachpit.</p>
<p>Ullman, L. 2008k. Common Programming Techniques (Using Hidden Form Inputs Section). In PHP 6 and MySQL 5, 264-266. Berkeley: Peachpit Press.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/leonsned24blog.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/leonsned24blog.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/leonsned24blog.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/leonsned24blog.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/leonsned24blog.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/leonsned24blog.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/leonsned24blog.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/leonsned24blog.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/leonsned24blog.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/leonsned24blog.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/leonsned24blog.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/leonsned24blog.wordpress.com/242/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/leonsned24blog.wordpress.com/242/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/leonsned24blog.wordpress.com/242/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=leonsned24blog.wordpress.com&amp;blog=8391971&amp;post=242&amp;subd=leonsned24blog&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://leonsned24blog.wordpress.com/2009/08/23/our-favourites/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/8014cfa983d540b0e561915945c32d69?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">leonjonharris</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/code_rand1.jpg" medium="image">
			<media:title type="html">code_rand</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/rand11.jpg" medium="image">
			<media:title type="html">rand1</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/rand22.jpg" medium="image">
			<media:title type="html">rand2</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/code_favq.jpg" medium="image">
			<media:title type="html">code_favq</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/code_favget.jpg" medium="image">
			<media:title type="html">code_favget</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/code_favgetcheck.jpg" medium="image">
			<media:title type="html">code_favgetcheck</media:title>
		</media:content>

		<media:content url="http://leonsned24blog.files.wordpress.com/2009/08/bcfav.jpg" medium="image">
			<media:title type="html">bcfav</media:title>
		</media:content>
	</item>
	</channel>
</rss>
