<?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>Sam Ruston</title>
	<atom:link href="http://www.samruston.co.uk/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.samruston.co.uk</link>
	<description>Web Development</description>
	<lastBuildDate>Wed, 01 Sep 2010 18:11:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Apple Music Event September 2010 Overview</title>
		<link>http://www.samruston.co.uk/?p=171</link>
		<comments>http://www.samruston.co.uk/?p=171#comments</comments>
		<pubDate>Wed, 01 Sep 2010 18:11:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[10]]></category>
		<category><![CDATA[4.0]]></category>
		<category><![CDATA[4.1]]></category>
		<category><![CDATA[4.2]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[camera]]></category>
		<category><![CDATA[click]]></category>
		<category><![CDATA[coverflow]]></category>
		<category><![CDATA[event]]></category>
		<category><![CDATA[HD]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[live]]></category>
		<category><![CDATA[multi]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[nano]]></category>
		<category><![CDATA[new]]></category>
		<category><![CDATA[ping]]></category>
		<category><![CDATA[products]]></category>
		<category><![CDATA[recording]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[shuffle]]></category>
		<category><![CDATA[snow]]></category>
		<category><![CDATA[stream release]]></category>
		<category><![CDATA[touch]]></category>
		<category><![CDATA[touchscreen]]></category>
		<category><![CDATA[updates]]></category>
		<category><![CDATA[wheel]]></category>

		<guid isPermaLink="false">http://www.samruston.co.uk/?p=171</guid>
		<description><![CDATA[Apple have released a long line of products in the last event, Apple&#8217;s Music Event. They have revamped the iPod ]]></description>
			<content:encoded><![CDATA[<p>Apple have released a long line of products in the last event, Apple&#8217;s Music Event. They have revamped the iPod line and have announced a few pieces of software for the computer market and the iOS product line.</p>
<p>1. iOS 4.1<br />
Apple announced iOS 4.1 for the iPhone and iPod Touch which should be available in a few days for the devices listed below:<br />
. iPhone 4<br />
. iPhone 3GS<br />
. iPhone 3G<br />
. iPhone Original<br />
. iPod Touch 3rd Generation<br />
. iPod Touch 2nd Generation<br />
Features include:<br />
. HDR (When taking photos the camera fixes detail issues and controls the exposure)<br />
. Game Centre for public use</p>
<p>2. iOS 4.2<br />
This release is iOS 4 for the iPad. Along with the features in iOS 4.1. The iPad&#8217;s iOS 4.2 comes with more, greater features. First of all it contains all of the new features from the original release of iOS 4.0 (folders and multi-tasking). This release also has:<br />
. Wireless printing</p>
<p>3. iPod Shuffle<br />
The iPod Shuffle has returned with the buttons from the 3rd generation model and has a similar look to the 3rd generation iPod Shuffle. </p>
<p>4. iPod Nano<br />
The iPod Nano has a complete redesign from any of the previous models. It now doesn&#8217;t have a click wheel and just looks like a display. Similar to a small iPod Touch or iPhone, it has a multi-touch display with a range of applications.</p>
<p>5. iPod Touch<br />
The iPod Touch has a similar design to previous generations. It is now a lot thinner than the current generation and boasts two camera. A HD rear facing camera for shooting video and taking photos. Also, it has a front facing camera for Facetime (video calling premièred in the iPhone 4).</p>
<p>6. Ping<br />
Ping is Apple&#8217;s new music social network. Think of it as Facebook, just without most of the features. You have the ability to post updates to your friends and can track recent activity of your favourite artists. Ping will also be available in the App Store for iOS devices.</p>
<p>7. Apple TV<br />
Apple have released a new Apple TV model which has a drastic new design. The case is now black and has a matte texture. Also, it is a quarter the size of the previous model. The new model is based on streaming technologies. This means you won&#8217;t have storage problems. You can stream music and movies from your computer, Youtube, Flickr or other media sharing websites.</p>
<p>8. iTunes 10<br />
Apple will release a new version of iTunes, named iTunes 10. It has a new logo, ditching the traditional CD and replacing it with a circle container. It also has a new view that integrates cover art into the list view menu for your music.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.samruston.co.uk/?feed=rss2&amp;p=171</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tips to Make Your Website Look like a Native iPad/iPhone App</title>
		<link>http://www.samruston.co.uk/?p=169</link>
		<comments>http://www.samruston.co.uk/?p=169#comments</comments>
		<pubDate>Wed, 01 Sep 2010 14:59:57 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[address]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[Application]]></category>
		<category><![CDATA[bar]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[events]]></category>
		<category><![CDATA[gestures]]></category>
		<category><![CDATA[home]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[icon]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[ipad]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[ipod]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[native]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[prevent]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[Safari]]></category>
		<category><![CDATA[scaling]]></category>
		<category><![CDATA[screen]]></category>
		<category><![CDATA[touch]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[Website]]></category>

		<guid isPermaLink="false">http://www.samruston.co.uk/?p=169</guid>
		<description><![CDATA[Web applications are great, you have the freedom of the entire web and its power. Not only that, but they ]]></description>
			<content:encoded><![CDATA[<p>Web applications are great, you have the freedom of the entire web and its power. Not only that, but they are a lot easier to create than native software applications. However, the problem arises on a hand held device, such as the iPad and iPhone. A website in the mobile version of Safari loses a lot of screen real estate and lacks some of the features that native applications have. Here are 5 simple and quick tips to make your web application feel more like a native iPad or iPhone application.</p>
<p>1. A Home Screen Icon<br />
All native applications on the iOS platform have their own application icon. This is usually a small graphic that is displayed above the title of the shortcut. Safari has a feature which allows you to add a website to the home screen as a shortcut to the actual web page.<br />
First create an icon that has the same width and height. These dimensions should be around 96 x 96 for the iPhone&#8217;s retina display. Save the file as &#8220;apple-touch-icon.png&#8221;. Next, upload the file to the root directory of your server. This means that the valid URL of the image would be, http://domain.extension/apple-touch-icon.png. The iPad, iPhone or iPod Touch will recognise the file when the user tries to add your website to the home screen.</p>
<p>2. Remove Safari&#8217;s Address Bar and Navigation Buttons<br />
If the user of your website uses the icon (see Step 1) to navigate to your website you have a few extra rights in the Safari browser. One of these abilities is that you can remove Safari&#8217;s navigation buttons and address bar. To do this simply add the code below into the <head> section of your web page.</p>
<p><meta name="apple-mobile-web-app-capable" content="yes" /></p>
<p>3. Prevent Zooming in<br />
Unless added by the programmer, you cannot zoom in or scale the size of native applications on the iPad or iPhone. However, it is set by default in Safari. To stop the user being able to zoom in on your website. Add the code below to your <head> section.</p>
<p><meta name="viewport" content="user-scalable=no, width=device-width" /></p>
<p>4. Create a Splash Screen (Loading Screen)<br />
If you want to show the user a pretty loading screen while your content is still being loaded, simply add the code below, once again to the <head> section of your page and change the href property to the desired location of your splash screen image.<br />
Note : You can only use the resolution 320 x 480 for the iPhone and 1004 x 768 for the iPad.</p>
<link rel="apple-touch-startup-image" href="" />
<p>5. Touch Gesture Detection<br />
Since the iOS runs on touch screen devices you no longer need to use onClick as the user is no longer operating your website using a mouse. You can use techniques designed by Apple to allow a little more freedom and creativity in your web applications. The Javascript event handlers are as follows:<br />
Finger touches screen &#8211; ontouchstart<br />
Finger moves on screen &#8211; ontouchmove<br />
Finger is released from screen &#8211; ontouchend<br />
Gesture starts (scaling or rotation) &#8211; ongesturestart<br />
Gesture stage changes &#8211; ongesturechange<br />
Gesture ends &#8211; ongestureend</p>
]]></content:encoded>
			<wfw:commentRss>http://www.samruston.co.uk/?feed=rss2&amp;p=169</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Design Tip : CSS3 Shadows</title>
		<link>http://www.samruston.co.uk/?p=161</link>
		<comments>http://www.samruston.co.uk/?p=161#comments</comments>
		<pubDate>Mon, 30 Aug 2010 13:30:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[3]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[glow]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[shadow]]></category>
		<category><![CDATA[shadows]]></category>

		<guid isPermaLink="false">http://www.samruston.co.uk/?p=161</guid>
		<description><![CDATA[CSS3 seems to be taking over the web due to its amazing list of features and easy usability. One of ]]></description>
			<content:encoded><![CDATA[<p>CSS3 seems to be taking over the web due to its amazing list of features and easy usability. One of the greatest features that can make any element look like it has been created in an image editor is CSS3&#8242;s box shadows. Similar to CSS3&#8242;s text-shadow effect, it can applied very easily.</p>
<p>Code:</p>
<div id="_mcePaste">-webkit-box-shadow: 0px 0px 6px #666666;</div>
<div id="_mcePaste">-moz-box-shadow: 0px 0px 6px #666666;</div>
<div id="_mcePaste">box-shadow: 0px 0px 6px #666666;</div>
<p>There are 4 properties, the selected values for these properties should be applied to each of the 3 lines of code.</p>
<p>First we have a numerical value for the amount of pixels the shadow should be applied to from the left. Secondly, we have the amount of pixels from the top. Next, we have the size of the shadow. The larger the value the greater area the shadow will cover. Finally, we have a hexadecimal value, proceeded after a hash to define the color of the shadow.</p>
<p>Demo (Above Settings) :</p>
<div style="width:200px; height:150px; -webkit-box-shadow: 0px 0px 6px #666666;<br />
-moz-box-shadow: 0px 0px 6px #666666; margin-left:20px;<br />
box-shadow: 0px 0px 6px #666666;">
</div>
<p>
Demo (Other Settings) :</p>
<div style="width:100px; height:300px; background-color:#eee; margin-left:20px; -webkit-box-shadow: 0px 0px 12px #FFAAAA;<br />
-moz-box-shadow: 0px 0px 12px #FAFAFA;<br />
box-shadow: 0px 0px 12px #FAFAFA;">
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.samruston.co.uk/?feed=rss2&amp;p=161</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Design Tip : Editable Content</title>
		<link>http://www.samruston.co.uk/?p=151</link>
		<comments>http://www.samruston.co.uk/?p=151#comments</comments>
		<pubDate>Mon, 30 Aug 2010 13:00:28 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[Content]]></category>
		<category><![CDATA[contenteditable]]></category>
		<category><![CDATA[contenteditable="true"]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Editable]]></category>
		<category><![CDATA[editablecontent]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[Website]]></category>

		<guid isPermaLink="false">http://www.samruston.co.uk/?p=151</guid>
		<description><![CDATA[Textboxes and textareas are great but the fact of the matter is the only content they can contain is plain ]]></description>
			<content:encoded><![CDATA[<p>Textboxes and textareas are great but the fact of the matter is the only content they can contain is plain text. Everything inside of them is rendered as just text, even if you write HTML inside of a textarea. An easy way to fix this is to use an element property called Editable Content. It is very easy to enable and it changes almost any element into a textbox. For example, if you create a DIV containing images and text. Then you enable this feature on the DIV. The user will be able to delete, move and even add to the DIV without it affecting the actual file.</p>
<p>To enable it, find your element and add this property:</p>
<p>contenteditable=&#8221;true&#8221;</p>
<p>For example:</p>
<p>&lt;div contenteditable=&#8221;true&#8221;&gt;&lt;/div&gt;</p>
<p>A normal object:</p>
<div style="width: 300px; background-color: #ccc; color: #000;">
<h3>Test Content in Heading</h3>
<p>Normal text<br />
<img src="http://www.samruston.co.uk/wp-content/uploads/2010/08/editablecontenttestimage.PNG" alt="" /></p>
</div>
<p>With Content Editable enabled:</p>
<div contenteditable="true" style="width: 300px; background-color: #ccc; color: #000;">
<h3>Test Content in Heading</h3>
<p>Normal text<br />
<img src="http://www.samruston.co.uk/wp-content/uploads/2010/08/editablecontenttestimage.PNG" alt="" /></p>
</div>
<p>In some web browsers, such as Google Chrome, it will place a border around the box when it is in focus. To get rid of this in your CSS add the property outline:none on the element. Here is our final code and demo.</p>
<div id="_mcePaste">&lt;div contenteditable=&#8221;true&#8221; style=&#8221;width: 300px; background-color: #ccc; color: #000; outline:none;&#8221;&gt;</div>
<div id="_mcePaste">&lt;h3&gt;Test Content in Heading&lt;/h3&gt;</div>
<div id="_mcePaste">Normal text</div>
<div id="_mcePaste">&lt;img src=&#8221;http://www.samruston.co.uk/wp-content/uploads/2010/08/editablecontenttestimage.PNG&#8221; alt=&#8221;" /&gt;</div>
<div id="_mcePaste">&lt;/div&gt;</div>
<p></p>
<div contenteditable="true" style="width: 300px; background-color: #ccc; color: #000; outline:none;">
<h3>Test Content in Heading</h3>
<p>Normal text<br />
<img src="http://www.samruston.co.uk/wp-content/uploads/2010/08/editablecontenttestimage.PNG" alt="" />
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.samruston.co.uk/?feed=rss2&amp;p=151</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Design Tip : Creating a Sidebar</title>
		<link>http://www.samruston.co.uk/?p=148</link>
		<comments>http://www.samruston.co.uk/?p=148#comments</comments>
		<pubDate>Sun, 29 Aug 2010 19:00:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[Updates]]></category>
		<category><![CDATA[bar]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[building]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[create]]></category>
		<category><![CDATA[creating]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[float]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[left]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[right]]></category>
		<category><![CDATA[side]]></category>
		<category><![CDATA[sidebar]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[Website]]></category>

		<guid isPermaLink="false">http://www.samruston.co.uk/?p=148</guid>
		<description><![CDATA[If you are just starting out in website design, then you may need to know how to create a sidebar. ]]></description>
			<content:encoded><![CDATA[<p>If you are just starting out in website design, then you may need to know how to create a sidebar. Also, you will want to know how to move the sidebar into its correct location, whether it be to the left or the right of the main content box.<br />
Here is how to create a sidebar.</p>
<p>HTML:</p>
<div id="main">
<p>&lt;div id=&#8221;main&#8221;&gt;</p>
<p>&lt;div id=&#8221;content&#8221;&gt;</p>
<p>&lt;/div&gt;</p>
<p>&lt;div id=&#8221;sidebar&#8221;&gt;</p>
<p>&lt;/div&gt;</p>
<p>&lt;/div&gt;</p>
<p>CSS:</p>
<p>&lt;style type=&#8221;text/css&#8221;&gt;</p>
<p>#main {</p>
<p>width:900px;</p>
<p>margin-left:auto;</p>
<p>margin-right:auto;</p>
<p>overflow:hidden;</p>
<p>}</p>
<p>#content {</p>
<p>width:650px;</p>
<p>float:left;</p>
<p>}</p>
<p>#sidebar {</p>
<p>width:250px;</p>
<p>float:right;</p>
<p>}</p>
<p>&lt;/style&gt;</p>
<p>Although you will not be able to see it without applying other CSS style elements, you have successfully created a sidebar and aligned into directly to the right of the main content box.</p>
<p><span style="text-decoration: underline;">Left Sidebar </span></p>
<p>CSS:</p>
<p>&lt;style type=&#8221;text/css&#8221;&gt;</p>
<p>#main {</p>
<p>width:900px;</p>
<p>margin-left:auto;</p>
<p>margin-right:auto;</p>
<p>overflow:hidden;</p>
<p>}</p>
<p>#content {</p>
<p>width:650px;</p>
<p>float:right;</p>
<p>}</p>
<p>#sidebar {</p>
<p>width:250px;</p>
<p>float:left;</p>
<p>}</p>
<p>&lt;/style&gt;</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.samruston.co.uk/?feed=rss2&amp;p=148</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Design Tip : The Float Problem</title>
		<link>http://www.samruston.co.uk/?p=122</link>
		<comments>http://www.samruston.co.uk/?p=122#comments</comments>
		<pubDate>Sun, 29 Aug 2010 12:00:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[auto]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[float]]></category>
		<category><![CDATA[height]]></category>
		<category><![CDATA[hidden]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[issue]]></category>
		<category><![CDATA[left]]></category>
		<category><![CDATA[overflow]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[right]]></category>
		<category><![CDATA[scroll]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[width]]></category>

		<guid isPermaLink="false">http://www.samruston.co.uk/?p=122</guid>
		<description><![CDATA[In CSS, it is common to use the float tag to create a layout for your website. However, an issue ]]></description>
			<content:encoded><![CDATA[<p>In CSS, it is common to use the float tag to create a layout for your website. However, an issue is that the parent&#8217;s dimensions sometimes become distorted.</p>
<p>Example:</p>
<div>
<div style="width: 500px; background-color: #ccc; padding:5px;">
<div style="width: 100px; height: 100px; background-color: #999; float: left;"></div>
<div style="width:300px; height:100px; background-color:#FFF; float:left;">
</div>
<div style="width: 100px; height: 100px; background-color: #999; float: right;"></div>
</div>
</div>
<p>Fix:</p>
<p>To fix it you simply need to add the CSS property, overflow:hidden to the parent element.</p>
<p>New Code:</p>
<div id="_mcePaste">&lt;div style=&#8221;width:500px; background-color:#CCC; padding:5px; overflow:hidden;&#8221;&gt;</div>
<div id="_mcePaste">&lt;div style=&#8221;width:100px; height:100px; background-color:#999; float:left;&#8221;&gt;</div>
<div id="_mcePaste">&lt;/div&gt;</div>
<div id="_mcePaste">&lt;div style=&#8221;width:100px; height:100px; background-color:#999; float:right;&#8221;&gt;</div>
<div id="_mcePaste">&lt;/div&gt;</div>
<div id="_mcePaste">&lt;/div&gt;</div>
<div></div>
<div></div>
<div style="width: 500px; background-color: #ccc; overflow: hidden; padding:5px;">
<div style="width: 100px; height: 100px; background-color: #999; float: left;"></div>
<div style="width: 100px; height: 100px; background-color: #999; float: right;"></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.samruston.co.uk/?feed=rss2&amp;p=122</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build a PHP URL Shortener</title>
		<link>http://www.samruston.co.uk/?p=114</link>
		<comments>http://www.samruston.co.uk/?p=114#comments</comments>
		<pubDate>Sun, 29 Aug 2010 10:00:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Custom]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Shorten]]></category>
		<category><![CDATA[Shortener]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[URI]]></category>
		<category><![CDATA[URL]]></category>
		<category><![CDATA[Website]]></category>

		<guid isPermaLink="false">http://www.samruston.co.uk/?p=114</guid>
		<description><![CDATA[If you use Twitter, Facebook or other social networking websites you may be familiar with limits that they have on ]]></description>
			<content:encoded><![CDATA[<p>If you use Twitter, Facebook or other social networking websites you may be familiar with limits that they have on the amount of characters. For example, Twitter limits you to 140 characters per tweet. So, to combat this issue people started to build online URL shorteners which transformed a long URL like, http://www.website.extension/dir1/dir2/dir3/filename?param1=value&amp;&amp;param2=value into a short URL such as, http://www.shorten.com/552454545. Here is how to build your own simple, custom URL shortener in PHP.</p>
<p>Requirements:<br />
. Knowledge of PHP to Debug<br />
. Knowledge of HTML to show elements<br />
. Knowledge of CSS to style elements<br />
. A server</p>
<p>In this project we are going to separate the code into many files as this is the best way of writing code. You should usually do this anyway.</p>
<p>Files:<br />
. index.php &#8211; Main file to transmit data, add URLs and redirect<br />
. mysql.php &#8211; To connect to the database<br />
. functions.php &#8211; To hold most of our redirect and adding code</p>
<p>First we will start with the mysql.php file. This is a straight forward file which has only one purpose. To connect to the database with the MySQL connection details specified.<br />
Code:</p>
<div id="_mcePaste">&lt;?php</div>
<div id="_mcePaste">$connect = mysql_connect(&#8220;localhost&#8221;, &#8220;xeromi_wuzly&#8221;, &#8220;seamruston2&#8243;) or die(&#8220;Could Not connect!&#8221;);</div>
<div id="_mcePaste">mysql_select_db(&#8220;xeromi_wuzly&#8221;) or die(&#8220;Could Not Find Database&#8221;);</div>
<div id="_mcePaste">?&gt;</div>
<p>&lt;?php</p>
<p>$connect = mysql_connect(&#8220;DB HOST&#8221;, &#8220;DB USER&#8221;, &#8220;DB PASSWORD&#8221;) or die(&#8220;Could Not connect!&#8221;);<br />
mysql_select_db(&#8220;DB NAME&#8221;) or die(&#8220;Could Not Find Database&#8221;);</p>
<p>?&gt;</p>
<p>Next, we will create our index.php page.</p>
<p>Code:</p>
<p>&lt;?php</p>
<p>include &#8216;functions.php&#8217;;</p>
<p>$redirectcode = $_GET['code'];</p>
<p>$url = $_POST['url'];</p>
<p>if($url!=&#8221;)</p>
<p>{</p>
<p>$newcode = shorten_url($url);</p>
<p>}</p>
<p>if($redirectcode!=&#8221;)</p>
<p>{</p>
<p>redirect($redirectcode);</p>
<p>} else {</p>
<p>if($newcode!=&#8221;)</p>
<p>{</p>
<p>echo $newcode;</p>
<p>}</p>
<p>?&gt;</p>
<p>&lt;form action=&#8221;" method=&#8221;POST&#8221;&gt;</p>
<p>&lt;input type=&#8221;text&#8221; name=&#8221;url&#8221;&gt;&lt;input type=&#8221;submit&#8221; value=&#8221;Shorten!&#8221;&gt;</p>
<p>&lt;/form&gt;</p>
<p>&lt;?php</p>
<p>}</p>
<p>?&gt;</p>
<p>Now that we have that completed, we only have the main file, the functions file left.</p>
<p>&lt;?php</p>
<p>include &#8216;mysql.php&#8217;;</p>
<p>function shorten_url($url) {</p>
<p>$randomcode = rand(1000000,9999999);</p>
<p>$shorten_url = mysql_query(&#8220;INSERT INTO `TABLE NAME` VALUES(&#8221;,&#8217;$url&#8217;,'$randomcode&#8217;)&#8221;);</p>
<p>$newcode = &#8216;/PLACE DIRECTORY URL HERE/?code=&#8217;.$randomcode;</p>
<p>}</p>
<p>function redirect($code) {</p>
<p>$query_get_url = mysql_query(&#8220;SELECT * FROM  `TABLE NAME` WHERE code = &#8216;$code&#8217;&#8221;);</p>
<p>$numrows_get_url = mysql_num_rows($query_get_url);</p>
<p>if($numrows_get_url!=0)</p>
<p>{</p>
<p>while ($row = mysql_fetch_assoc($query_get_url))</p>
<p>{</p>
<div>$url = $row['url'];</div>
<div>?&gt;</div>
<div>&lt;meta http-equiv=&#8221;refresh&#8221; content=&#8221;0;url=&lt;?php echo $url; ?&gt;&#8221;&gt;</div>
<div>&lt;?php</div>
<p>}</p>
<p>}</p>
<p>}</p>
<p>?&gt;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.samruston.co.uk/?feed=rss2&amp;p=114</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free Online Website Grader</title>
		<link>http://www.samruston.co.uk/?p=112</link>
		<comments>http://www.samruston.co.uk/?p=112#comments</comments>
		<pubDate>Sat, 28 Aug 2010 12:00:53 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Review]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[grader]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[improve]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[rank]]></category>
		<category><![CDATA[ranker]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[web]]></category>
		<category><![CDATA[webiste]]></category>

		<guid isPermaLink="false">http://www.samruston.co.uk/?p=112</guid>
		<description><![CDATA[Ranking highly on Google and other popular search engines can prove a difficult task for competitive keywords. If you have ]]></description>
			<content:encoded><![CDATA[<p>Ranking highly on Google and other popular search engines can prove a difficult task for competitive keywords. If you have just created a website or have had one for quite a while you want to build as much traffic to it as you can. Resulting in more revenue if you use Google Adsense or other revenue generating services.</p>
<p>There is a free tool which not only ranks your website on a scale of 1 to 100. But it gives you an in-depth report about what you need to improve on to get yourself a higher score. This service is called the Website SEO Tool. Which can be located at <a href="http://websitegrader.com/" rel="nofollow">http://websitegrader.com/</a>.</p>
<p>It ranks your website on numerous factors and even some that search engines will not take into account. However, here are a few examples of aspects which it will help you improve on:<br />
. Image Data for Image Search Engines<br />
. Social transfer or your content<br />
. Backlink count</p>
<p>Along with judging factors, the report includes information about your general website. Such as: Moz Rank, incoming backlinks and site age.</p>
<p>Positives:<br />
. Helps you improve your website<br />
. Free</p>
<p>Negatives:<br />
. Limit amount of use per day<br />
. Sometimes can be slow at grading</p>
<p>Overall, I recommend you use this tool whenever you create a website.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.samruston.co.uk/?feed=rss2&amp;p=112</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CSS3 Transition Introduction</title>
		<link>http://www.samruston.co.uk/?p=99</link>
		<comments>http://www.samruston.co.uk/?p=99#comments</comments>
		<pubDate>Fri, 27 Aug 2010 22:33:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[3]]></category>
		<category><![CDATA[Animate]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[Background]]></category>
		<category><![CDATA[Color]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[Effect]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[Size]]></category>
		<category><![CDATA[Transition]]></category>
		<category><![CDATA[transitions]]></category>

		<guid isPermaLink="false">http://www.samruston.co.uk/?p=99</guid>
		<description><![CDATA[With flash being attack with new ways of generating web pages, such as HTML 5 and Javascript. There is now ]]></description>
			<content:encoded><![CDATA[<p>With flash being attack with new ways of generating web pages, such as HTML 5 and Javascript. There is now a new way of creating beautiful and smooth effects on websites. CSS3. Using CSS3 transitions is very simple but will only work in certain browsers.</p>
<p>Supported Browsers:</p>
<p>. Webkit Based Browsers</p>
<p>. Mozilla Firefox ( 4.0 +)</p>
<p>Here is a short introduction about CSS3 to help you get started with it.</p>
<p>There is no better way to get started than to start programming. We are going to create an animation that will allow the color of a DIV to change over the time period of half a second. You have probably seen a similar appearance that occurs when you hover over an element and it changes. However, what you may have not seen is an animation between the two states of appearance.</p>
<p>So, lets get started!</p>
<p>First, we will create our basic structure for our HTML document.</p>
<p>Note : When actually using this effect and with most web design habits, you should store your CSS and even Javascript in separate files and then link them to the actual HTML document.</p>
<p>Code:</p>
<p>&lt;!DOCTYPE HTML&gt;</p>
<p>&lt;html&gt;</p>
<p>&lt;head&gt;</p>
<p>&lt;title&gt;CSS3 Animations&lt;/title&gt;</p>
<p>&lt;/head&gt;</p>
<p>&lt;body&gt;</p>
<p>&lt;/body&gt;</p>
<p>&lt;/html&gt;</p>
<p>Now we need to create our DIV.</p>
<p>&lt;div id=&#8221;cssbox&#8221;&gt;&lt;/div&gt;</p>
<p>Next, we need to place the CSS below into the HEAD section of our document.</p>
<p>&lt;style type=&#8221;text/css&#8221;&gt;</p>
<p>#cssbox {</p>
<p>-webkit-transition:0.5s;</p>
<p>-moz- transition:0.5s;</p>
<p>width:150px;</p>
<p>height:150px;</p>
<p>cursor:pointer;</p>
<p>background-color:#CCC;</p>
<p>}</p>
<p>#cssbox:hover {</p>
<p>background-color:#eee;<br />
}</p>
<p>&lt;/style&gt;</p>
<p>Now we will place all of our code together. Which will look like this:</p>
<p>&lt;!DOCTYPE HTML&gt;</p>
<p>&lt;html&gt;</p>
<p>&lt;head&gt;</p>
<p>&lt;title&gt;CSS3 Animations&lt;/title&gt;</p>
<p>&lt;style type=&#8221;text/css&#8221;&gt;</p>
<p>#cssbox {</p>
<p>-webkit-transition:0.5s;</p>
<p>-moz- transition:0.5s;</p>
<p>width:150px;</p>
<p>height:150px;</p>
<p>cursor:pointer;</p>
<p>background-color:#CCC;</p>
<p>}</p>
<p>#cssbox:hover {</p>
<p>background-color:#eee;<br />
}</p>
<p>&lt;/style&gt;</p>
<p>&lt;/head&gt;</p>
<p>&lt;body&gt;</p>
<p>&lt;div id=&#8221;cssbox&#8221;&gt;&lt;/div&gt;</p>
<p>&lt;/body&gt;</p>
<p>&lt;/html&gt;</p>
<p>Giving the output of:</p>
<div id="cssbox"></div>
<p>Other examples by changing different CSS properties:</p>
<div id="cssbox2"></div>
<p></p>
<div id="cssbox3"></div>
<p></p>
<div id="cssbox4"></div>
<p>Fun (Run your cursor from top to bottom of these DIVs):</p>
<div id="cssbox5"></div>
<div id="cssbox6"></div>
<div id="cssbox7"></div>
<div id="cssbox8"></div>
<div id="cssbox9"></div>
<div id="cssbox10"></div>
<div id="cssbox11"></div>
<div id="cssbox12"></div>
<div id="cssbox13"></div>
<div id="cssbox14"></div>
<div id="cssbox15"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.samruston.co.uk/?feed=rss2&amp;p=99</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax Post &#8211; Insert MySQL Data</title>
		<link>http://www.samruston.co.uk/?p=95</link>
		<comments>http://www.samruston.co.uk/?p=95#comments</comments>
		<pubDate>Wed, 25 Aug 2010 14:13:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[insert]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.samruston.co.uk/?p=95</guid>
		<description><![CDATA[In the past, I have posted a tutorial to help you to create your own search suggestion script. However, you ]]></description>
			<content:encoded><![CDATA[<p>In the past, I have posted a tutorial to help you to create your own search suggestion script. However, you may need to reverse it to insert data instead of gathering data. When sending data, a method of some-what encryption or hiding it from other loggers needs to occur to make the script secure. This is why we need to use the POST method. You may be familiar the POST method in PHP or other languages. However, you may not know how to use it in Ajax.</p>
<p>Lets get started with the file structure. We need 3 files to make the script function.</p>
<p>Files:</p>
<p>. ajax_framework.js</p>
<p>. insert_data.php</p>
<p>. index.php</p>
<p>Information:</p>
<p>. The Ajax Framework will be used to send data between files and start up and close the Ajax connections.</p>
<p>. The Insert Data file will run the query which will insert our data into the database.</p>
<p>. The Index file will communicate with the Ajax Framework to start up the connection and it will be the only file which the user will be able to see.</p>
<p>First we will start with the index.php.</p>
<p>Contents:</p>
<p>&lt;!DOCTYPE HTML&gt;</p>
<p>&lt;html&gt;</p>
<p>&lt;head&gt;</p>
<p>&lt;title&gt;Ajax POST Demonstration&lt;/title&gt;</p>
<p>&lt;script src=&#8221;ajax_framework.js&#8221; language=&#8221;javascript&#8221;&gt;&lt;/script&gt;</p>
<p>&lt;/head&gt;</p>
<p>&lt;body&gt;</p>
<p>&lt;input type=&#8221;text&#8221; id=&#8221;mysqltext&#8221;&gt;</p>
<p>&lt;input type=&#8221;button&#8221; value=&#8221;Input Data&#8221; onclick=&#8221;input_mysql_data();&#8221;&gt;</p>
<p>&lt;/body&gt;</p>
<p>&lt;/html&gt;</p>
<p>This Index file has the same structure as a normal HTML document with one optional addition. The DOCTYPE &lt;!DOCTYPE HTML&gt;, this specifies that HTML 5 should be enabled. It doesn&#8217;t need to be in this demonstration, but you should think about using it in your own projects.</p>
<p>Next, we will start with our second easiest file, insert_data.php.</p>
<p>Contents:</p>
<p>&lt;?php</p>
<p>// Start Our MySQL Connection</p>
<div id="_mcePaste">$connect = mysql_connect(&#8220;DATABASE HOST&#8221;, &#8220;DATABASE USER&#8221;, &#8220;DATABASE PASSWORD&#8221;) or die(&#8220;Could Not connect!&#8221;);</div>
<div id="_mcePaste">mysql_select_db(&#8220;DATABASE NAME&#8221;) or die(&#8220;Could Not Find Database&#8221;);</div>
<div>// Get Data from ajax_framework.js</div>
<p>$mysql_text = $_POST['mysql_text'];</p>
<p>// Add text to table in database</p>
<p>$add_text = mysql_query(&#8220;INSERT INTO `TABLE NAME` VALUES(&#8221;,&#8217;$mysql_text&#8217;)&#8221;);</p>
<p>Note : Make sure you change the text for the TABLE NAME, DATABASE HOST, DATABASE USER, DATABASE PASSWORD, DATABASE NAME. Also, make sure you alter the table structure in the query above (the current version will only insert data into a table that has two columns).</p>
<p>?&gt;</p>
<p>Finally, we must create our Ajax Framework file to send the data between the Index file and the Insert Data file.</p>
<p>Contents:</p>
<p>// Start up our Connection</p>
<p>function createObject() {</p>
<p><span style="white-space: pre;"> </span>var request_type;</p>
<p><span style="white-space: pre;"> </span>var browser = navigator.appName;</p>
<p><span style="white-space: pre;"> </span>if(browser == &#8220;Microsoft Internet Explorer&#8221;){</p>
<p><span style="white-space: pre;"> </span>request_type = new ActiveXObject(&#8220;Microsoft.XMLHTTP&#8221;);</p>
<p><span style="white-space: pre;"> </span>} else {</p>
<p><span style="white-space: pre;"> </span>request_type = new XMLHttpRequest();</p>
<p><span style="white-space: pre;"> </span>}</p>
<p><span style="white-space: pre;"> </span>return request_type;</p>
<p>}</p>
<p>var http = createObject();</p>
<p>function input_mysql_data() {</p>
<p>var mysql_text = document.getElementById(&#8216;mysql_text&#8217;).value;</p>
<p>var url = &#8220;insert_data.php&#8221;;</p>
<p>var params = &#8220;mysql_text=&#8221; + mysql_text;</p>
<p>http.open(&#8220;POST&#8221;, url, true);</p>
<p>http.setRequestHeader(&#8220;Content-type&#8221;, &#8220;application/x-www-form-urlencoded&#8221;);</p>
<p>http.setRequestHeader(&#8220;Content-length&#8221;, params.length);</p>
<p>http.setRequestHeader(&#8220;Connection&#8221;, &#8220;close&#8221;);</p>
<p>http.send(params);</p>
<p>}</p>
<p>This will now start up our connection and send the data to the insert_data.php.</p>
<p>Here is the cycle of data transfer:</p>
<p>Load Index.php -&gt; Enter Text and Click Button -&gt; Start insert_mysql_data function -&gt; Get Text from Text box -&gt; Send to insert_data.php -&gt; Insert into MySQL Database</p>
]]></content:encoded>
			<wfw:commentRss>http://www.samruston.co.uk/?feed=rss2&amp;p=95</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
