<?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>Sunny Man&#039;s Blog &#187; Tutorials</title>
	<atom:link href="http://blog.eop.org.uk/category/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.eop.org.uk</link>
	<description></description>
	<lastBuildDate>Thu, 09 Sep 2010 13:53:39 +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>Student Advice: Managing Your Money</title>
		<link>http://blog.eop.org.uk/508-student-advice-managing-your-money/</link>
		<comments>http://blog.eop.org.uk/508-student-advice-managing-your-money/#comments</comments>
		<pubDate>Sat, 14 Aug 2010 11:42:49 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Educational]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/?p=508</guid>
		<description><![CDATA[Reluctantly sliding on into my third year of my university course this September, I thought it wise to share some of my experiences with managing money as a student who has been living in halls for one year and privately rented accommodation for the other. Some of us are lucky in that our parents moonlight [...]]]></description>
			<content:encoded><![CDATA[<p>Reluctantly sliding on into my third year of my university course this September, I thought it wise to share some of my  experiences with managing money as a student who has been living in halls for one year and privately rented accommodation for the other. Some of us are lucky in that our parents moonlight as an infinite supply of money, but for those who don&#8217;t have that luxury we have to manage our money like responsible adults. Bummer, I know.</p>
<p>Not managing our money properly can lead to terrible decisions that have to be made; Do you buy the food for the week or the cheap beer that&#8217;s only on offer today? Do you pay your rent or go out every night in a week? As you&#8217;re a student, and because you&#8217;re reading this article, you&#8217;ve obviously gone weeks without eating and been behind on your rent. On a serious note, this can not only effect your health, well being and state of mind, but also result in you becoming homeless or having legal action taken against you. Not what you want at any point during your university life.</p>
<p>In my experience, living in halls on your campus or private halls elsewhere is the easy option. Payments are, usually, in tune with student loan payments and bills and utility payments are usually included in the price. Your first year is usually one crazy year and one you&#8217;ll want to cram lots into. For this you need money. Halls is definitely the way to go here.</p>
<p>A few simple things you can do though, to make the most of your first year and prepare for the second. Firstly, if you do receive a student loan and maintenance grants, put them into a high interest savings account. This will hopefully provide you with a few extra quid through interest. Most student accounts require you to use that current account as your main account, and they do check. So have the funds sent to that account and then transfer them to your high interest savings account. Secondly, set aside a certain amount that you will transfer from your current account to a savings account. This is the easy part, but leaving that fund alone will be the hard part. Usually, opening an e-ISA or other savings account is usually free, requiring an initial £1 deposit but this may vary. Basically, it&#8217;s easy so there&#8217;s no excuse.</p>
<p>When it comes to your second year at university, you&#8217;re probably going to move into privately rented accommodation with your mates. That was my decision, anyway. When you do, do your research. What is the normal weekly cost in your area? What length are the tenancies? Will you get a summer concession during the summer months when you&#8217;re probably not even going to be living in the house? There are a few things to consider that your SU can probably help you with. Moving into a house, or flat, is a more complicated experience. Firstly, try and go through websites such as Unipol which will hopefully keep the nasty, evil landlords from your computer screen. See the properties. Ask them about the things listed above. And most of all, ask how you&#8217;ll be paying. Some like to be paid monthly, or in instalments. Work out when the money will leave your account, and when any money will be entering it from loans or jobs etc. You don&#8217;t want to fall behind on payments; although many landlords are quite forgiving, some are not and missing a single payment, even by a day, can be a breach of contract which can lead to eviction.</p>
<p>A top tip for living privately is to plan how much you have to spend over each period between rent payments. Don&#8217;t spend more than you have. It&#8217;s not worth the hassle.</p>
<p>Other things you can do to help include getting the <a href="http://cow.neondragon.net/">best phone contract</a> you can, so downgrading to a cheaper tariff, only turning the heating on in your house for a few hours a day. Those sorts of things go a long way. Not getting Sky, Virgin Media or BT, but sticking to Freeview or better yet, just using your laptops/computers to watch your favourite programs. Looking for the best internet deal for your property and not just sticking to the provider that the previous tenants had. And, don&#8217;t use your overdraft if you don&#8217;t have to.</p>
<h2>So, what have we learnt?</h2>
<p>Well, if you&#8217;re a student you probably didn&#8217;t read all of that. So, here are Sunny Man&#8217;s top student finance tips to help you have a money trouble free year at university:</p>
<ul>
<li>Transfer your loans/grants into a high interest savings account.</li>
<li>Put aside £5/£10 a week into a savings account over the year.</li>
<li>Know when and what you have to pay and to who.</li>
<li>Try not to use your overdraft, however good it looks.</li>
<li>Have fun, it&#8217;ll be the best years of your life so far&#8230;</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/508-student-advice-managing-your-money/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>3D Hill Plot with MATLAB</title>
		<link>http://blog.eop.org.uk/481-3d-hill-plot-with-matlab/</link>
		<comments>http://blog.eop.org.uk/481-3d-hill-plot-with-matlab/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 17:59:38 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Educational]]></category>
		<category><![CDATA[MATLAB]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/?p=481</guid>
		<description><![CDATA[I thought I&#8217;d share some of the easier things I had to do as part of the first year of my course. One of those tasks was to generate a 3D plot of a function and then also plot 2D cross sections at different values. We start off with a mathematical function that describes, what [...]]]></description>
			<content:encoded><![CDATA[<p>I thought I&#8217;d share some of the easier things I had to do as part of the first year of my course. One of those tasks was to generate a 3D plot of a function and then also plot 2D cross sections at different values.</p>
<p>We start off with a mathematical function that describes, what we will call, our hill. This function represents the &#8216;height&#8217; of our hill, h if you will, at the different points in x and y.</p>
<p><a href="http://blog.eop.org.uk/wp-content/uploads/2010/07/eq1.jpg"><img class="aligncenter size-full wp-image-482" title="Hill Plot Equation" src="http://blog.eop.org.uk/wp-content/uploads/2010/07/eq1.jpg" alt="exp(-(x.^2)-(y.^2)) + 0.5.*exp(-((x-2).^2)-(y.^2));" width="434" height="107" /></a></p>
<p>So, in our MATLAB script we first of all generate a grid of points using x values from -1.5 to 3.5 and y values from -2 to 2. The follow code achieves this.</p>
<p><code>x = linspace(-1.5,3.5,50); <span style="color: #ff6600;">% 50 values of x</span><br />
y = linspace(-2,2,25); <span style="color: #ff6600;">% 25 values of x</span><br />
[xg yg] = meshgrid(x,y); <span style="color: #ff6600;">% generate points</span></code></p>
<p>And next we generate the height values of our hill, using the grid we have just created with x -&gt; xg and y -&gt;yg.</p>
<p><code>h = exp(-(xg.^2)-(yg.^2)) + 0.5.*exp(-((xg-2).^2)-(yg.^2)); <span style="color: #ff6600;">% calculate height values</span></code></p>
<p>With our hight values in the array h, all we need to do now is plot them. Firstly, to create the 3D plot we just plot x,y and h using the <strong>surf()</strong> function.</p>
<p><code>figure(1); <span style="color: #ff6600;">% create new figure window</span><br />
surf(x,y,h); <span style="color: #ff6600;">% surface plot</span><br />
title('3D Hill Plot'); <span style="color: #ff6600;">% title and axis labels</span><br />
xlabel('x');<br />
ylabel('y');<br />
zlabel('height');</code></p>
<p>Now, to look at several slices through the hill at different values of y, we need to select the different values of y from its array and plot them on the same graph.</p>
<p><code>figure(2);<br />
plot(x,h([1,10,20],:)); <span style="color: #ff6600;">% plot 1st, 10th and 20th values of y</span><br />
title('2D Hill Plot'); <span style="color: #ff6600;">% title and axis labels</span><br />
xlabel('x');<br />
ylabel('height');<br />
legend('y = -1.5','y = -0.4','y = 1.2',0); <span style="color: #ff6600;">% legend not overlapping any of the plot</span></code></p>
<p>Putting it all together you get a 3D plot of the function and the cross sections in two windows. Job done.</p>
<p style="text-align: center;"><a href="http://blog.eop.org.uk/wp-content/uploads/2010/07/matlab1.jpg"><img class="aligncenter size-medium wp-image-486" title="3D Hill Plot" src="http://blog.eop.org.uk/wp-content/uploads/2010/07/matlab1-300x224.jpg" alt="" width="240" height="179" /></a><a href="http://blog.eop.org.uk/wp-content/uploads/2010/07/matlab2.jpg"><img class="aligncenter size-medium wp-image-487" title="2D Hill Cross Sections" src="http://blog.eop.org.uk/wp-content/uploads/2010/07/matlab2-300x224.jpg" alt="" width="240" height="179" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/481-3d-hill-plot-with-matlab/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create Fractals with MATLAB</title>
		<link>http://blog.eop.org.uk/457-create-fractals-with-matlab/</link>
		<comments>http://blog.eop.org.uk/457-create-fractals-with-matlab/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 04:29:01 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Educational]]></category>
		<category><![CDATA[MATLAB]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/?p=457</guid>
		<description><![CDATA[As part of my University course we had to use the scientific MATLAB programming language, and computing environment,  for several tasks in the first year. While the set tasks were as drab and dreary as you would expect from a Physics course, it taught us the basic skills and the problem solving skills key to [...]]]></description>
			<content:encoded><![CDATA[<p>As part of my University course we had to use the scientific <a href="http://www.mathworks.com/products/matlab/">MATLAB</a> programming language, and computing environment,  for several tasks in the first year. While the set tasks were as drab and dreary as you would expect from a Physics course, it taught us the basic skills and the problem solving skills key to the course.</p>
<p>In my spare time I ported a PHP script <a href="http://cow.neondragon.net/index.php/2680-Php-Fractal-Generator">my friend</a> created to MATLAB which enables the creation of beautiful fractals from the Mandlebrot set. The maximum image size you can create depends on the amount of memory available in your system and the script isn&#8217;t something I&#8217;ve spent a lot of time on so feel free to improve on it.</p>
<p>On my laptop, a 10,000 x 10,000 pixel image took about an hour to create, using 20 iterations. You may find this differs on other machines.</p>
<p style="text-align: center;"><a href="http://blog.eop.org.uk/wp-content/uploads/2010/07/BIG.jpg"><img class="aligncenter size-medium wp-image-458" title="Example Fractal" src="http://blog.eop.org.uk/wp-content/uploads/2010/07/BIG-300x163.jpg" alt="" width="300" height="163" /></a><br />
Download the <a href="http://blog.eop.org.uk/wp-content/uploads/2010/07/fractals.txt">MATLAB Fractal Generator Code</a>.</p>
<p style="text-align: left;">
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/457-create-fractals-with-matlab/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Lesson 8</title>
		<link>http://blog.eop.org.uk/349-php-lesson-8/</link>
		<comments>http://blog.eop.org.uk/349-php-lesson-8/#comments</comments>
		<pubDate>Wed, 14 Feb 2007 12:16:31 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/349-php-lesson-8/</guid>
		<description><![CDATA[My lessons are now into their second week and we’ve still got a way to go yet. This week we will be looking into IF and WHILE statements, $_GET, $_POST and we’ll also look into arrays near the end of the week. Yesterday we did a simple lesson on $_GET and how to get values [...]]]></description>
			<content:encoded><![CDATA[<p><img class="float_l" src='http://blog.eop.org.uk/wp-content/uploads/2007/02/tutorials.jpg' alt='Sunny Man’s Tutorials' />My lessons are now into their second week and we’ve still got a way to go yet. This week we will be looking into IF and WHILE statements, $_GET, $_POST and we’ll also look into arrays near the end of the week.</p>
<p><a href="http://blog.eop.org.uk/348-php-lesson-7/">Yesterday</a> we did a simple lesson on $_GET and how to get values from a URL. Today another simple lesson on $_POST and the confusion that comes with it. I introduced you to $_POST in last Friday&#8217;s big special and today we are going into much more detail.</p>
<h5>Lesson 8: $_POST and Forms</h5>
<p>As I showed in Friday&#8217;s round up, we use $_POST to collect the values of submitted form data. Some confusion that I had for a while was whether or not to use the <strong>name</strong> or <strong>id</strong> attribute in the form fields to let $_POST work. I&#8217;ll settle this now &#8211; for $_POST to collect the data from the form fields, you need to assign a name attribute to them. The <strong>id</strong> can be used for labels, <abbr title="Cascading Style Sheets">CSS</abbr> classes and other things. Here&#8217;s a sample form <strong>form.php</strong>:</p>
<p><code>&lt;form action="process.php" method="post"&gt;<br />
First Name: &lt;input type="text" name="fname" size="25" /&gt;<br />
Last Name: &lt;input type="text" name="lname" size="25" /&gt;<br />
Over 16? &lt;input type="radio" name="age" value="1" /&gt; Yes &lt;input type="radio" name="age" value="0" /&gt; No<br />
&lt;input type="submit" value="submit form" /&gt;<br />
&lt;/form&gt;</code></p>
<p>In the above form we would get 3 values returned through $_POST. These would be the first name, last name and over 16 values. Here&#8217;s how we&#8217;d capture these values. This file would be <strong>process.php</strong>, as determined in the form&#8217;s first line:</p>
<p><code>&lt;?php<br />
$fname = $_POST['fname'];<br />
$lname = $_POST['lname'];<br />
$age = $_POST['age']; <span style="color:#0cf;">//either 1 or 0</span><br />
<br />$name = $fname." ".$lname; <span style="color:#0cf;">//stitch the first and last names together</span><br />
?&gt;</code></p>
<p>Pretty simple to get the form fields&#8217; values. On Friday we are going to combine everything and a lot of form fields to create a signup form which will include this, arrays and a bit of validation.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/349-php-lesson-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Lesson 7</title>
		<link>http://blog.eop.org.uk/348-php-lesson-7/</link>
		<comments>http://blog.eop.org.uk/348-php-lesson-7/#comments</comments>
		<pubDate>Tue, 13 Feb 2007 18:34:47 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/348-php-lesson-7/</guid>
		<description><![CDATA[My lessons are now into their second week and we’ve still got a way to go yet. This week we will be looking into IF and WHILE statements, $_GET, $_POST and we’ll also look into arrays near the end of the week. In the previous lesson we went into detail about IF and WHILE statements [...]]]></description>
			<content:encoded><![CDATA[<p><img class="float_l" src='http://blog.eop.org.uk/wp-content/uploads/2007/02/tutorials.jpg' alt='Sunny Man’s Tutorials' />My lessons are now into their second week and we’ve still got a way to go yet. This week we will be looking into IF and WHILE statements, $_GET, $_POST and we’ll also look into arrays near the end of the week.</p>
<p>In the <a href="http://blog.eop.org.uk/345-php-lesson-6/">previous lesson</a> we went into detail about IF and WHILE statements and in Friday&#8217;s big round up I introduced you to $_POST and $_GET. Today we&#8217;re going to look further at $_GET and what it&#8217;s used for.</p>
<h5>Lesson 7: $_GET and URLs</h5>
<p>When we have a URL that includes the values of certain variables, we can use this to get the values. Say we had a URL like this:</p>
<p><code>http://www.eop.org.uk/index.php?name=sunny%20man&#038;cool=yes</code></p>
<p>We use $_GET to grab the values of the <em>name</em> and <em>cool</em> variables. Obviously this isn&#8217;t a secure way to transport variables around your site &#8211; we&#8217;ll look at a more secure way later on into the tutorials &#8211; this is the most simple way.</p>
<p><code>&lt;?php<br />
$name = $_GET['name']; <span style="color:#0cf;">//$name = "sunny man"</span><br />
$cool = $_GET['cool']; <span style="color:#0cf;">//$cool = "yes"</span><br />
?&gt;</code></p>
<p>Tomorrow I&#8217;ll be talking about $_POST and how it can be confusing when to use the name and id attributes on form field inputs.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/348-php-lesson-7/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Lesson 6</title>
		<link>http://blog.eop.org.uk/345-php-lesson-6/</link>
		<comments>http://blog.eop.org.uk/345-php-lesson-6/#comments</comments>
		<pubDate>Mon, 12 Feb 2007 10:25:37 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/345-php-lesson-6/</guid>
		<description><![CDATA[My lessons are now into their second week and we&#8217;ve still got a way to go yet. This week we will be looking into IF and WHILE statements, $_GET, $_POST and we&#8217;ll also look into arrays near the end of the week. As always we will find a useful example we can apply everything to [...]]]></description>
			<content:encoded><![CDATA[<p><img class="float_l" src='http://blog.eop.org.uk/wp-content/uploads/2007/02/tutorials.jpg' alt='Sunny Man’s Tutorials' />My lessons are now into their second week and we&#8217;ve still got a way to go yet. This week we will be looking into IF and WHILE statements, $_GET, $_POST and we&#8217;ll also look into arrays near the end of the week.</p>
<p>As always we will find a useful example we can apply everything to at the end of the week as well as introducing some things we are going to look at in the following week. I hope you&#8217;ve learnt something in the previous week but don&#8217;t worry we will get more advanced as time goes on.</p>
<h5>Lesson 6: IF and WHILE</h5>
<p>In last week&#8217;s final day lesson I introduced you to an IF statement. I&#8217;m going to go over them in more detail today as well as introducing you to a WHILE loop. Here&#8217;s the IF statement I used in Friday&#8217;s example:</p>
<p><code>if ($username == "username" &#038;&#038; $password == "password") {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...<br />
}</code></p>
<p>This says: <em>if $username&#8217;s value is &#8220;username&#8221; and if $password&#8217;s value is &#8220;password&#8221; then do this&#8230;</em> If the statement in the <strong>( )</strong> brackets are true then it executes the instructions within the <strong>{ }</strong> brackets.</p>
<p>There are a variety of comparison operators that you can use. The one used in the example is <strong>==</strong> which means equal to. There is also <strong>!=</strong> &#8211; not equal to, <strong>===</strong> &#8211; exactly equal and of the same type, <strong>!==</strong> not exactly equal and not of the same type, <strong>&gt;</strong> &#8211; is bigger than, <strong>&lt;</strong> &#8211; is smaller than, <strong>&gt;=</strong> &#8211; is bigger than or equal to, <strong>&lt;=</strong> &#8211; is smaller than or equal to.</p>
<p>If you want to check more than one thing in an IF statement then you need to use logical operators, such as in the example I&#8217;ve used <strong>&#038;&#038;</strong> to indicate that the statement should be true if the username <strong>and</strong> the password are both correct. Here are some examples:</p>
<p><code>if ($username || $password) { ... } <span style="color:#0cf;">// OR</span><br />
if (!$username) { ... } <span style="color:#0cf;">// NOT</span><br />
if ($username XOR $password) { ... } <span style="color:#0cf;">// XOR (exclusive OR)</span></code></p>
<p>Now we have got the hard bit out of the way we can now look at WHILE statements. WHILE statements are a little different to IF statements because they perform the instructions inside the <strong>{ }</strong> brackets while a comparison remains true.</p>
<p><code>&lt;?php<br />
$a = 1;<br />
$b = 5;<br />
<br />while ($a &lt; $b) { <span style="color:#0cf;">//while $a is less than $b</span><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo $a;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$a++; <span style="color:#0cf;">//increment $a by 1</span><br />
}<br />
?&gt;</code></p>
<p>WHILE loops come in very handy sometimes &#8211; for example when we look at arrays we will use a WHILE loop to good effect. A famous example of using &#8216;the loop&#8217; is the WordPress blogging system. This is the basic form of IF and WHILE loops. Remember them!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/345-php-lesson-6/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP Lesson 5</title>
		<link>http://blog.eop.org.uk/344-php-lesson-5/</link>
		<comments>http://blog.eop.org.uk/344-php-lesson-5/#comments</comments>
		<pubDate>Fri, 09 Feb 2007 19:18:30 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/344-php-lesson-5/</guid>
		<description><![CDATA[Well we&#8217;ve reached the end of week one of my series of lessons on PHP. We are going to incorporate everything we have learnt in lessons one, two, three and four. In today&#8217;s lesson we&#8217;re going to create a login script in PHP and you&#8217;ll see all you&#8217;ve learnt in it as well as some [...]]]></description>
			<content:encoded><![CDATA[<p><img class="float_l" src='http://blog.eop.org.uk/wp-content/uploads/2007/02/tutorials.jpg' alt='Sunny Man’s Tutorials' />Well we&#8217;ve reached the end of week one of my series of lessons on PHP. We are going to incorporate everything we have learnt in lessons <a href="http://blog.eop.org.uk/336-php-lesson-1/">one</a>, <a href="http://blog.eop.org.uk/338-php-lesson-2/">two</a>, <a href="http://blog.eop.org.uk/339-php-lesson-3/">three</a> and <a href="http://blog.eop.org.uk/342-php-lesson-4/">four</a>.</p>
<p>In today&#8217;s lesson we&#8217;re going to create a login script in PHP and you&#8217;ll see all you&#8217;ve learnt in it as well as some new things that we are going to cover in next week&#8217;s lessons &#8211; 6 to 9. Enjoy and try it out yourself on your own server. We will take another look at this script later on and implement a mySQL connection into the script &#8211; but don&#8217;t worry about this until later.</p>
<h5>Lesson 5: Simple Login Script</h5>
<p>First of all we will take the simple username and password form from lesson 4 and use this. This will be our <strong>login.php</strong> file. Here it is again:</p>
<p><code>&lt;form action="process.php" method="post"&gt;<br />
Username: &lt;input type="text" name="username" size="25" /&gt;<br />
Password: &lt;input type="password" name="password" size="25" /&gt;<br />
&lt;input type="submit" value="submit form" /&gt;<br />
&lt;/form&gt;</code></p>
<p>Now we&#8217;ll extend this with some extra PHP code which will be used to display any error messages if the user inputs an invalid username or password. This will be added above the form code.</p>
<p><code>&lt;?php<br />
if($_GET['e']) {<br />
        $error = "Wrong username or password. Please try again.";<br />
}<br />
<br />if($error) {<br />
        ?&gt;<br />
        &lt;p style="padding:10px;border:red;color:black;"&gt;<br />
        &lt;?php echo $error; ?&gt;<br />
        &lt;/p&gt;<br />
        &lt;?php<br />
}<br />
?&gt;</code></p>
<p>Okay so now we can create the <strong>process.php</strong> file which will digest the submitted form data. Take a look at the file and go over the previous four lessons to see what you can remember how to do.</p>
<p><code>&lt;?php<br />
$username = $_POST['username'];<br />
$password = $_POST['password'];<br />
<br />if(!$username || !$password) {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;header("Location:login.php?e=1");<br />
}<br />
else {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if ($username == "username" &#038;&#038; $password == "password") {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;header("Location:members.php");<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else {<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;header("Location:login.php?e=1");<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}<br />
?&gt;</code></p>
<p>There may be things in there you don&#8217;t understand just yet but I assure you we&#8217;ll get to them. IF statements, $_GET global and some other things are what we&#8217;re going to visit in next week&#8217;s tutorials. When we&#8217;ve learnt functions and mySQL connections we will revisit this form and make it more dynamic. Hope you enjoyed these extremely simple and basic tutorials. See you next week.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/344-php-lesson-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP Lesson 4</title>
		<link>http://blog.eop.org.uk/342-php-lesson-4/</link>
		<comments>http://blog.eop.org.uk/342-php-lesson-4/#comments</comments>
		<pubDate>Thu, 08 Feb 2007 09:03:31 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/342-php-lesson-4/</guid>
		<description><![CDATA[Previously we looked at some of the methods PHP offers to sort and manipulate strings and we specifically looked at str_replace() and encryption methods like md5() and sha1(). In this lesson, the final one before a big project, we&#8217;re going to take a look at how to capture inputs from form fields. Also I&#8217;m going [...]]]></description>
			<content:encoded><![CDATA[<p><img class="float_l" src='http://blog.eop.org.uk/wp-content/uploads/2007/02/tutorials.jpg' alt='Sunny Man’s Tutorials' /><a href="http://blog.eop.org.uk/339-php-lesson-3/">Previously</a> we looked at some of the methods PHP offers to sort and manipulate strings and we specifically looked at <strong>str_replace()</strong> and encryption methods like <strong>md5()</strong> and <strong>sha1()</strong>.</p>
<p>In this lesson, the final one before a big project, we&#8217;re going to take a look at how to capture inputs from form fields. Also I&#8217;m going to talk about the secure and insecure ways to transfer the data.</p>
<h5>Lesson 4: Form Field Input</h5>
<p>Getting the input from a form is pretty simple and in this lesson we are going to keep it that way by using two files: <strong>form.php</strong> and <strong>process.php</strong>. The first will contain the form we are going to create which a user will fill in. The latter file will take the input, process it and output it.</p>
<p>Here&#8217;s the sample form we&#8217;re going to use. In this case it&#8217;s just a simple username and password form. This form does not validate and is in no way conforming to accessibility either.</p>
<p><code>&lt;form action="process.php" method="post"&gt;<br />
Username: &lt;input type="text" name="username" size="25" /&gt;<br />
Password: &lt;input type="password" name="password" size="25" /&gt;<br />
&lt;input type="submit" value="submit form" /&gt;<br />
&lt;/form&gt;</code></p>
<p>Once the user submits the information by the button they&#8217;ll be taken to <strong>process.php</strong> along with the values of the form fields. We use the <strong>$_POST</strong> global to take the form values. For example if we wanted to take the value of the username field and assign it to <em>$username</em>:</p>
<p><code>$username = $_POST['username'];<br />
<span style="color:#0cf;">//getting the value of the form field with the name of 'username'</span></code></p>
<p>The variable in between the square brackets refers to the <em>name=&#8221;"</em> part of the inputs in the form. So now we can create the <strong>process.php</strong> file from what we&#8217;ve learned.</p>
<p><code>&lt;?php<br />
$username = $_POST['username'];<br />
$password = $_POST['password'];<br />
<br />echo "You're username is ".$username." and your password is ".$password.".";<br />
?&gt;</code></p>
<p>So there is the simple way to collect and assign form variables sent over pages. The next lesson, lesson 5, is where we are going to put all we&#8217;ve learnt from lessons 1 to 4 into practise. You&#8217;ll use what you&#8217;ve learnt and some new stuff that will introduce you to lessons 6 to 9. Learn it!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/342-php-lesson-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Lesson 3</title>
		<link>http://blog.eop.org.uk/339-php-lesson-3/</link>
		<comments>http://blog.eop.org.uk/339-php-lesson-3/#comments</comments>
		<pubDate>Wed, 07 Feb 2007 07:56:56 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/339-php-lesson-3/</guid>
		<description><![CDATA[In lesson 2 we touched on variables in PHP and how to create one and then change it via a number of processes. Today we&#8217;re going to use some of the functions that PHP provide which allow us to manipulate and query strings and that will most likely become very handy in the future. If [...]]]></description>
			<content:encoded><![CDATA[<p><img class="float_l" src='http://blog.eop.org.uk/wp-content/uploads/2007/02/tutorials.jpg' alt='Sunny Man’s Tutorials' />In <a href="http://blog.eop.org.uk/338-php-lesson-2/">lesson 2</a> we touched on variables in PHP and how to create one and then change it via a number of processes. Today we&#8217;re going to use some of the functions that PHP provide which allow us to manipulate and query strings and that will most likely become very handy in the future.</p>
<p>If you wish to take a look at the functions it offers then head on over to the <a href="http://uk.php.net/manual/en/ref.strings.php">PHP Manual</a>, specifically the string functions.</p>
<h5>Lesson 3: String Functions</h5>
<p>Last week we touched on how to find the length of a string using the <strong>strlen()</strong> function. Today we&#8217;re going to look at a few more functions and put them into a practical example. To find the length of a string all we have to do is employ this function as is shown here:</p>
<p><code>&lt;?php<br />
$five = strlen("mouse"); <span style="color:#0cf;">//$five's value is 5</span><br />
$word = "mousemat";<br />
$eight = strlen($word); <span style="color:#0cf;">//$eight's value is 8</span><br />
?&gt;</code></p>
<p>Now we&#8217;re going to look at replacing characters or phrases within a string with something else. To do this in the simplest way we are going to use the <strong>str_replace()</strong> function. There&#8217;s several <strong>parameters</strong> to this function. This means that we have to provide more information within the functions. In this case the format is <strong>str_replace(</strong><em>string to search for</em>, <em>string to replace it with</em>, <em>string to search within</em><strong>)</strong>.</p>
<p><code>$string = "Sunny Man’s Blog";<br />
$string = str_replace("Man","Boy",$string); <span style="color:#0cf;">//replace 'Man' with 'Boy'</span><br />
echo $string; <span style="color:#0cf;">//displays Sunny Boy's Blog</span></code></p>
<p>Later on when we get to talking about SQL and databases you&#8217;ll need to be able to encrypt strings. There are several different types of encryption available in PHP. All of them are simple enough to use but, as we will will discuss later on, knowing when to use the correct one is vital. First let&#8217;s take a look at the different types.</p>
<p><code>$password = md5("password");<br />
echo $password; <span style="color:#0cf;">//5F4DCC3B5AA765D61D8327DEB882CF99</span><br />
<br />$password = sha1("password");<br />
echo $password; <span style="color:#0cf;">//5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8</span></code></p>
<p>Both md5 and sha1 have their advantages and disadvantages but they&#8217;re both quick to generate and once stored in a variable, easy to remember. Say we wanted to take a raw password that was given to us by a form (we&#8217;ll cover this soon), replace the letter &#8216;i&#8217; with &#8216;z&#8217; and encrypt it for storage in a database, this is how we would do it:</p>
<p><code>&lt;?php<br />
$password = "birmingham";<br />
$password = str_replace("i","z",$password);<br />
$password = md5($password);<br />
?&gt;</code></p>
<p>This is the end of lesson 3. In the next lesson we&#8217;ll talk about taking variables from a form, collecting them and manipulating them in a real life situation. After than we&#8217;re going to put all we&#8217;ve learnt into a logging in script in lesson 5 which will introduce you to salts, database queries and some other stuff we will cover in lessons 6 to 10.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/339-php-lesson-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Lesson 2</title>
		<link>http://blog.eop.org.uk/338-php-lesson-2/</link>
		<comments>http://blog.eop.org.uk/338-php-lesson-2/#comments</comments>
		<pubDate>Tue, 06 Feb 2007 08:03:30 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/338-php-lesson-2/</guid>
		<description><![CDATA[In a previous post I started you off on the basics of PHP and you managed to get Hello World! displayed on the screen. This lesson we are going to learn about how to create, use and manage variables. Hope you enjoy it&#8230; Lesson 2: Variables Unlike programming languages such as C++, in PHP you [...]]]></description>
			<content:encoded><![CDATA[<p><img class="float_l" src='http://blog.eop.org.uk/wp-content/uploads/2007/02/tutorials.jpg' alt='Sunny Man’s Tutorials' />In a <a href="http://blog.eop.org.uk/336-php-lesson-1/">previous post</a> I started you off on the basics of PHP and you managed to get <strong>Hello World!</strong> displayed on the screen. This lesson we are going to learn about how to create, use and manage variables. Hope you enjoy it&#8230;</p>
<h5>Lesson 2: Variables</h5>
<p>Unlike programming languages such as C++, in PHP you don&#8217;t have to state what type of variable you&#8217;re creating when you create one. A variable such as <em>$myvar</em> could just as well be a number as it could be a word. It&#8217;s as easy as pie to create different variables:</p>
<p><code>&lt;?php<br />
$age = 15;<br />
$name = "John";<br />
?&gt;</code></p>
<p>Here we created 2 variables: <em>$age</em> and <em>$name</em> which values&#8217; are 15 and &#8216;John&#8217; respectively. It&#8217;s that easy to create variables. Now that we have created variables we can manipulate them. Say for example we wanted to increase the <em>$age</em> variable and assign the new value to <em>$age</em> again, this is what we would add before the end of the script:</p>
<p><code>$age = $age+1;</code></p>
<p>If we now output the <em>$age</em> variable we would find that it displays <strong>16</strong> and not 15.</p>
<p><code>echo $age; <span style="color:#0cf;">//this would display '15'</span></code></p>
<p>We can also attach strings together. Take the <em>$name</em> variable we created earlier. We can take that and also create a last name in a different variable and then string them together to make the <em>$name</em> variable include the first and last name. Here we go:</p>
<p><code>$lastname = "Smith";<br />
$fullname = $name.$lastname; <span style="color:#0cf;">//this would create "JohnSmith"</span><br />
$fullname = $name." ".$lastname; <span style="color:#0cf;">//this would create "John Smith"</span></code></p>
<p>So, let&#8217;s try and put this all together and make a useful program out of it. Here we manipulate the age by turning it into dog years. We also here string the first and last names together and then as a step towards the next lesson we&#8217;ll count the number of characters in the names.</p>
<p><code>&lt;?php<br />
$age = 15;<br />
$firstname = "John";<br />
$lastname = "Smith";<br />
$i = 0; <span style="color:#0cf;">//used later on as a counter</span><br />
<br />$dog = $age*7;<br />
echo "You're ".$age." human years old and ".$dog." dog years!";<br />
echo "&lt;br /&gt;"; <span style="color:#0cf;">//create a new line; just regular html</span><br />
<br />$name = $firstname." ".$lastname;<br />
$i = $i + strlen($firstname); <span style="color:#0cf;">//0 + 4</span><br />
$i = $i + strlen($lastname); <span style="color:#0cf;">//4 + 5</span><br />
echo $name.", you have ".$i." letters in your name!";<br />
?&gt;</code></p>
<p>Try it out and play around with it! Next lesson we&#8217;re going to look at some of the functions we can apply to strings such as getting the length of the string and searching for a specific item within a variable.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/338-php-lesson-2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PHP Lesson 1</title>
		<link>http://blog.eop.org.uk/336-php-lesson-1/</link>
		<comments>http://blog.eop.org.uk/336-php-lesson-1/#comments</comments>
		<pubDate>Mon, 05 Feb 2007 17:13:18 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Educational]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/336-php-lesson-1/</guid>
		<description><![CDATA[I&#8217;m going to start producing a few classes for those people who wish to start learning the wonderful programming language of PHP. These will be pretty simple classes and will reach until the end of my knowledge of the language. First, a bit of my experience &#8211; albeit a relatively short one. My History I [...]]]></description>
			<content:encoded><![CDATA[<p><img class="float_l" src='http://blog.eop.org.uk/wp-content/uploads/2007/02/tutorials.jpg' alt='Sunny Man’s Tutorials' />I&#8217;m going to start producing a few classes for those people who wish to start learning the wonderful programming language of <a href="http://www.php.net/">PHP</a>. These will be pretty simple classes and will reach until the end of my knowledge of the language. First, a bit of my experience &#8211; albeit a relatively short one.</p>
<h5>My History</h5>
<p>I first started to learn PHP 3 years ago and have since then done some things I&#8217;m quite proud of in the language. I&#8217;ve built a system for a hospital in Reading, my own blogging software (although quite simple, it does the job) and also a file directory viewer with AJAX technology. But, my PHP knowledge is quite limited and I have not used the language now for some times as I have been concentrating on the design aspect of the web.</p>
<h5>Lesson 1: Hello World!</h5>
<p>Every programmer starts off with the &#8216;Hello World!&#8217; program. Here we are going to get PHP to output the text &#8216;Hello World!&#8217; to the screen. From this point out I&#8217;ll assume you&#8217;ve installed PHP and have it running on <a href="http://www.apache.org/">Apache</a> or the like.</p>
<p>So, as with any PHP script we have to tell the server it&#8217;s going to be dealing with PHP. So we start it off with the opening and closing tags. All code goes between these tags:</p>
<p><code>&#60;?php<br />
?&#62;</code></p>
<p>Now, as I said all PHP code goes in between these tags. So, now we have to make it do what we want it to do. So, in between those tags we know insert this line of code which tells it to output the text to the screen:</p>
<p><code>echo "Hello World!";</code></p>
<p>Once we&#8217;ve put this all together we should be able to achieve the result we wanted. Try it yourself on your own server! Just save the following code as a .php file and run it!</p>
<p><code>&#60;?php<br />
echo "Hello World!";<br />
?&#62;</code></p>
<p>It&#8217;s going to get a bit more complicated than this, I can assure you. I&#8217;ll post a lesson every weekday &#8211; every Friday we&#8217;ll do a roundup of everything we&#8217;ve learnt!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/336-php-lesson-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Back From Tropical Devon</title>
		<link>http://blog.eop.org.uk/64-back-from-tropical-devon/</link>
		<comments>http://blog.eop.org.uk/64-back-from-tropical-devon/#comments</comments>
		<pubDate>Sat, 08 Apr 2006 14:22:49 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[News]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/?p=64</guid>
		<description><![CDATA[Well, I&#8217;m back and ready to entertain you with my words of wizdom and my thoughts. I got home today, sorted everything out and then opened my e-mail. It took me 25 minutes to sort through my e-mail (mostly spam but I&#8217;ve won a Cadbury&#8217;s Creme Egg Easter Egg ) and then another 35 minutes [...]]]></description>
			<content:encoded><![CDATA[<p>Well, I&#8217;m back and ready to entertain you with my words of wizdom and my thoughts. I got home today, sorted everything out and then opened my e-mail. It took me 25 minutes to sort through my e-mail (mostly spam but I&#8217;ve won a Cadbury&#8217;s Creme Egg Easter Egg <img src='http://blog.eop.org.uk/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> ) and then another 35 minutes to catch up on my RSS feeds. So, I&#8217;m gunna start this post.</p>
<p>Just before I left for the south-west county of Devon I recorded <a href="http://www.bbc.co.uk/food">Ready Steady Cook</a> with my Archos AV700 Portable DVR because two teachers from my school, Miss Penny and Ms Mora of the English and Modern Foreign Languages (MFL) departments respectively, were appearing on the show. I recorded it but couldn&#8217;t upload to Google Video because it was Friday night so me and a friend only just managed to torrent the thing. A more detailed post and the video can be found on <a href="http://opher.wordpress.com/">Opher&#8217;s [New] Blog</a> in <a href="http://opher.wordpress.com/2006/04/04/ready-steady-cook/">this post</a>. Enjoy.</p>
<p>Also, on the subject of <a href="http://opher.wordpress.com/">Opher&#8217;s Blog</a>, I&#8217;d suggest adding it to your RSS feeds list if you haven&#8217;t already. Although most of it is copied from the BBC News website <img src='http://blog.eop.org.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> , it&#8217;s still worth a read. Head on over there now. NOW!</p>
<p>I&#8217;m back now and I&#8217;ve been looking over my blog logs and found that my <a href="http://blog.eop.org.uk/?p=58">Google Earth and SketchUp tutorial</a> has been posted around a bit. Websites such as <a href="http://www.gearthblog.com/">GEarth Blog</a>, <a href="http://www.juicygeography.co.uk/">JuicyGeography</a> and <a href="http://www.akkamsrazor.com/2006/04/05/links-for-2006-04-06/">Akkam&#8217;s Razor</a> have posted links to my tutorial; quite flattering really. Check them out &#8211; for me <img src='http://blog.eop.org.uk/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p>Well, I dunno what else to post. Oh, I&#8217;ll post my homework list so you can all remind me of my impending doom:</p>
<ul>
<li><strong>English</strong> &#8211; Re-read anthology short stories and go over poem notes.</li>
<li><strong>Maths</strong> &#8211; Do exercise 3.3C, questions 1-4.</li>
<li><strong>Spanish</strong> &#8211; Decide on presentation topic and do <s>revision</s> reviewing of topics.</li>
<li><strong>Art</strong> &#8211; Do development work and collect more evidence.</li>
</ul>
<p>Well, I also reccomend you check out <a href="http://cow.neondragon.net/">Cow&#8217;s Blog</a>, <a href="http://blog.smileyxtra.co.uk/">The Bakery</a>, <a href="http://news.bbc.co.uk/">BBC News</a>, <a href="http://www.digg.com">Digg</a>, <a href="http://www.cad-comic.com/">Ctrl+Alt+Del</a> and <a href="http://www.engadget.com/">Engadget</a> while I regain my blogging powers.</p>
<p><strong>Sunny</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/64-back-from-tropical-devon/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Create Google Earth Models</title>
		<link>http://blog.eop.org.uk/58-google-earth-models-with-now-google-software/</link>
		<comments>http://blog.eop.org.uk/58-google-earth-models-with-now-google-software/#comments</comments>
		<pubDate>Wed, 15 Mar 2006 20:55:16 +0000</pubDate>
		<dc:creator>Sunny Man</dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://blog.eop.org.uk/?p=58</guid>
		<description><![CDATA[[digg it!] A few days ago, the news that Google had aquired @Last Software was released. This also meant that Google has aquired what I consider one of the mose easiest to use and &#8216;good looking&#8217; pieces of CAD software. This software is called SketchUp. I&#8217;ve been playing with it today and wanted to show [...]]]></description>
			<content:encoded><![CDATA[<p><strong><em><a href="http://digg.com/software/Google_Earth_Models_with_%5BGoogle%5D_SketchUp">[digg it!]</a></em></strong></p>
<p>A few days ago, the news that <a href="http://www.google.com/">Google</a> had aquired <a href="http://www.sketchup.com/">@Last Software</a> was released. This also meant that Google has aquired what I consider one of the mose easiest to use and &#8216;good looking&#8217; pieces of CAD software. This software is called <a href="http://www.sketchup.com/?id=130">SketchUp</a>. I&#8217;ve been playing with it today and wanted to show you how you can make your own models for <a href="http://earth.google.com/">Google Earth</a> in under 10 minutes. So, here we go.</p>
<p>First of all, get your hands on the SketchUp software and the <a href="http://www.sketchup.com/?section=downloads">Google Earth plugin</a>. Also, if you haven&#8217;t got Google Earth, download and install that. They&#8217;re not huge file sizes but (God forbid) dial-up users should start downloading now <img src='http://blog.eop.org.uk/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> . Okay, install SketchUp first and then install the plugin. This plugin will allow you to import current views from Google Earth to work with and creating your model. It also allows you to preview your model in Google Earth which is very handy. Okay, everything installed? Let&#8217;s go&#8230;</p>
<p><a href="http://img432.imageshack.us/my.php?image=tutorial14hl.jpg" target="_blank"><img src="http://img432.imageshack.us/img432/9774/tutorial14hl.th.jpg" border="0" alt="Free Image Hosting at www.ImageShack.us" style="float:left; margin: 5px;" /></a>Right, for my tutorial I&#8217;m going to create a very simple model (with no textures) of my house and the walls around it. It&#8217;s a very rough guide and should get you started. So, first of all, open up Google Earth and find the area you want to put the model on; in this case I&#8217;ve chosen my house. Get a perfect arial view and then open up SketchUp. This is the hardest part.</p>
<p><a href="http://imageshack.us"><img src="http://img432.imageshack.us/img432/9246/tutorial20jd.jpg" border="0" width="103" alt="Image Hosted by ImageShack.us" /></a>On first startup, skip the tutorial and click continue on the trial information screen. There, you should see a toolbar at the top that looks something like this.</p>
<p>Click the far left button to get the current Google Earth view. This will insert the Google Earth image onto your 3D canvas. This is only a guide so the greyscale and frankly crappy quality of the image is of no concern to us now. Now, to make sure you don&#8217;t have troubles with users who have the &#8216;terrain&#8217; feature turned on in Google Earth, click the middle button of that toolbar we mentioned. This will show the terrain on your 3D canvas. Okay, so you&#8217;re ready to create your model. In this tutorial, I&#8217;m going to create a not-to-scale model of my house, but just something I can recognise.</p>
<p><a href="http://img220.imageshack.us/my.php?image=tutorial39su.jpg" target="_blank"><img src="http://img220.imageshack.us/img220/4099/tutorial39su.th.jpg" border="0" alt="Free Image Hosting at www.ImageShack.us" style="float:left;margin: 5px;" /></a>Okay. So, first I&#8217;m going to create the main block of my house by selecting the &#8216;Rectangle&#8217; tool to the left and then using the &#8216;Push/Pull&#8217; tool to make it a cube &#8211; my house. Yours should look something like the image in the screenshot on the left. Now, we have to make the roof slanted to actually make it look more like a house. To do this, pick the &#8216;Pencil/Line&#8217; tool and on the top of the cube on one of the sides, go along it until the pointer square turns blue. <a href="http://img396.imageshack.us/my.php?image=tutorial44qo.jpg" target="_blank"><img src="http://img396.imageshack.us/img396/2030/tutorial44qo.th.jpg" border="0" alt="Free Image Hosting at www.ImageShack.us" style="float:left;margin: 5px;" /></a>There, click and draw the line to the other side of the roof where the square pointer will also turn blue (this means the line is straight). Okay, next we have to lift the roof up. </p>
<p>To life the roof up, select the line we just created with the &#8216;Select&#8217; tool and then select the <img src="http://img209.imageshack.us/img209/6457/cross9wc.jpg" border="0" /> tool and drag the line upwards. You&#8217;ll see that the rest of the cube&#8217;s top moves with it. Stop moving it when you&#8217;re happy with the result. This is our roof. Well, I&#8217;m going to stop with the modelling here and move on to exporting the model.</p>
<p><a href="http://img462.imageshack.us/my.php?image=tutorial50pw.jpg" target="_blank"><img src="http://img462.imageshack.us/img462/6233/tutorial50pw.th.jpg" border="0" alt="Free Image Hosting at www.ImageShack.us" style="float:left;margin: 5px;" /></a>Okay, so now you&#8217;ve got your model house, you now need to move it into the correct place on the map on your 3D canvas. Select the whole house with the &#8216;Select&#8217; tool and then use the &#8216;Move/Copy&#8217; tool we used earlier to move the whole house into the correct position. Now, as long as you haven&#8217;t changed the image in Google Earth everything should work. With Google Earth still open, in SketchUp go back to the Google Earth Plugin toolbar and select the far right button. This will take your model and preview it in Google Earth. Have a look and see what it looks like. Here&#8217;s my example.</p>
<div style="text-align:center;"><a href="http://img108.imageshack.us/my.php?image=tutorial60zn.jpg" target="_blank"><img src="http://img108.imageshack.us/img108/203/tutorial60zn.th.jpg" border="0" alt="Free Image Hosting at www.ImageShack.us" /></a></div>
<p>If you&#8217;re happy with your model, in SketchUp go to File -> Export -> 3D Model and select &#8216;Google Earth (*.kmz)&#8217;. You can then open this file in Google Earth and save it to your &#8216;My Places&#8217;. I&#8217;m sure you&#8217;d be able to create more details and better models than this one, but this is just to get you started. Have fun! Hopefully Google will actually make the product free.</p>
<p><a href="http://img384.imageshack.us/my.php?image=tutorial74bc.jpg" target="_blank"><img src="http://img384.imageshack.us/img384/4610/tutorial74bc.th.jpg" border="0" alt="Free Image Hosting at www.ImageShack.us" /></a><br />
(P.S: Here&#8217;s mine with the walls.)</p>
<p><!--adsense--></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.eop.org.uk/58-google-earth-models-with-now-google-software/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

