<?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>Code With Design &#187; tutorial</title>
	<atom:link href="http://codewithdesign.com/tag/tutorial/feed/" rel="self" type="application/rss+xml" />
	<link>http://codewithdesign.com</link>
	<description>web application development blog by Caleb Jonasson</description>
	<lastBuildDate>Thu, 15 Sep 2011 17:52:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Java: Tutorial about Arrays vs Static Arrays</title>
		<link>http://codewithdesign.com/2010/03/29/java-tutorial-about-arrays-vs-static-arrays/</link>
		<comments>http://codewithdesign.com/2010/03/29/java-tutorial-about-arrays-vs-static-arrays/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 09:50:06 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[dream in code]]></category>
		<category><![CDATA[static array]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=297</guid>
		<description><![CDATA[This is a tutorial found on dream in code that I recently stumbled upon. It gives you a good look at an alternative to an array when using anything over java JDK 5. The tutorial covers some of the built in methods that the the ArrayList class comes with. It also goes over sorting, looping, checking for null and changing index'.


Related posts:<ol><li><a href='http://codewithdesign.com/2010/04/07/writing-and-reading-objects-and-arrays-to-a-binary-file-with-java/' rel='bookmark' title='Permanent Link: Writing and reading objects and arrays to a binary file with java'>Writing and reading objects and arrays to a binary file with java</a></li>
<li><a href='http://codewithdesign.com/2010/03/31/advantages-to-writing-files-in-binary-with-java/' rel='bookmark' title='Permanent Link: Advantages to writing files in binary with java'>Advantages to writing files in binary with java</a></li>
<li><a href='http://codewithdesign.com/2010/03/31/reading-information-from-a-binary-file-with-java/' rel='bookmark' title='Permanent Link: Reading information from a binary file with java'>Reading information from a binary file with java</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style = 'float:left; margin-right:5px;'>            <a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-text="Java: Tutorial about Arrays vs Static Arrays" data-via="" data-url="http://codewithdesign.com/2010/03/29/java-tutorial-about-arrays-vs-static-arrays/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><g:plusone size="tall" href="http://codewithdesign.com/2010/03/29/java-tutorial-about-arrays-vs-static-arrays/"></g:plusone><p>This is a tutorial found on dream in code that I recently stumbled upon. It gives you a good look at an alternative to an array when using anything over java JDK 5. The tutorial covers some of the built in methods that the the ArrayList class comes with. It also goes over sorting, looping, checking for null and changing index&#8217;.</p>
<p>The tutorial was written by one of the moderators who goes by the screen name Locke.</p>
<p><a href="http://www.dreamincode.net/forums/index.php?showtopic=58935">You can find the tutorial here.</a></p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=297&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://codewithdesign.com/2010/04/07/writing-and-reading-objects-and-arrays-to-a-binary-file-with-java/' rel='bookmark' title='Permanent Link: Writing and reading objects and arrays to a binary file with java'>Writing and reading objects and arrays to a binary file with java</a></li>
<li><a href='http://codewithdesign.com/2010/03/31/advantages-to-writing-files-in-binary-with-java/' rel='bookmark' title='Permanent Link: Advantages to writing files in binary with java'>Advantages to writing files in binary with java</a></li>
<li><a href='http://codewithdesign.com/2010/03/31/reading-information-from-a-binary-file-with-java/' rel='bookmark' title='Permanent Link: Reading information from a binary file with java'>Reading information from a binary file with java</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2010/03/29/java-tutorial-about-arrays-vs-static-arrays/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Into to HTML: Creating A Basic Web Page</title>
		<link>http://codewithdesign.com/2009/11/16/into-to-html-creating-a-basic-web-page-2/</link>
		<comments>http://codewithdesign.com/2009/11/16/into-to-html-creating-a-basic-web-page-2/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 19:54:49 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[basics]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[intro to html]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=164</guid>
		<description><![CDATA[Now we are going to get into the more customizable areas of the website. This section of information is known as head information and is not displayed on the webpage itself. This information is once again read by the browser but you can tell the search engines what information to display along with the title of the page. There are many more things that you can do with this section of the text which I will be going over in another into to HTML article.


Related posts:<ol><li><a href='http://codewithdesign.com/2009/10/12/into-to-html-creating-a-basic-web-page/' rel='bookmark' title='Permanent Link: Into to HTML: Creating A Basic Web Page'>Into to HTML: Creating A Basic Web Page</a></li>
<li><a href='http://codewithdesign.com/2009/09/30/intro-to-html-css-creating-a-style-sheet/' rel='bookmark' title='Permanent Link: Intro to HTML: CSS Creating a Style Sheet'>Intro to HTML: CSS Creating a Style Sheet</a></li>
<li><a href='http://codewithdesign.com/2009/10/04/creating-a-single-page-login-%e2%80%93-design-view/' rel='bookmark' title='Permanent Link: Creating a Single Page login – Design View'>Creating a Single Page login – Design View</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style = 'float:left; margin-right:5px;'>            <a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-text="Into to HTML: Creating A Basic Web Page" data-via="" data-url="http://codewithdesign.com/2009/11/16/into-to-html-creating-a-basic-web-page-2/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><g:plusone size="tall" href="http://codewithdesign.com/2009/11/16/into-to-html-creating-a-basic-web-page-2/"></g:plusone><p>In order to create your own web page you should first open up a text editor such as notepad or notepad ++. First things first is to copy the following code into your text editor and save it as index.php. PHP is a server side programming language which is most commonly used across the web because of its simple integration with html. Actual PHP code requires a server but if there is html text inside of a PHP file a simple test on your computer will allow you to properly view the page.</p>
<blockquote><p>&lt;!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;<br />
&lt;html xmlns=”http://www.w3.org/1999/xhtml”&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /&gt;<br />
&lt;title&gt;Demo Website || featured on codewithdesign.com&lt;/title&gt;<br />
&lt;/head&gt;</p>
<p>&lt;body&gt;<br />
&lt;h1&gt;H1 tags&lt;/h1&gt;<br />
&lt;h2&gt;H2 tags&lt;/h2&gt;<br />
&lt;h3&gt;H3 tags&lt;/h3&gt;<br />
&lt;p&gt;The h1 stands for header1 and these p tags are paragraph tags&lt;/p&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>Now we are going to step through the code so you know exactly what is going on and how the web browser reads the information. The top line of the code will let your browser know what standards it is to follow when reading the code.</p>
<blockquote><p>&lt;!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;</p></blockquote>
<p>The second line of code states that it is going to follow the w3 standards.</p>
<blockquote><p>&lt;html xmlns=”http://www.w3.org/1999/xhtml”&gt;</p></blockquote>
<p>Now we are going to get into the more customizable areas of the website. This section of information is known as head information and is not displayed on the webpage itself. This information is once again read by the browser but you can tell the search engines what information to display along with the title of the page. There are many more things that you can do with this section of the text which I will be going over in another into to HTML article.</p>
<blockquote><p>&lt;head&gt;<br />
&lt;meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /&gt;<br />
&lt;title&gt;Demo Website || featured on codewithdesign.com&lt;/title&gt;<br />
&lt;/head&gt;</p></blockquote>
<p>The first bit of the code is very boring but now we can get more into the content of the page. As you can see there are greater and lesser then signs with content in between, these are called tags. When declaring information inside of a tag you need to have a starting tag and a closing tag. The closing tag is going to allow you to specify that it is closing and will always close the tag immediately before it. For every opening tag you need to have a closing tag or information will not be displayed properly.</p>
<blockquote><p>&lt;h1&gt;H1 tags&lt;/h1&gt;<br />
&lt;h2&gt;H2 tags&lt;/h2&gt;<br />
&lt;h3&gt;H3 tags&lt;/h3&gt;</p></blockquote>
<p>Notice how these tag examples are within the body tags. This means that the following content will be displayed within the body of the web browser. When you look at the page you will notice that it breaks into sections. The main section is html which contains the sub sections of head and body.</p>
<blockquote><p>&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></blockquote>
<p>You can start creating a site with just this information but it is a good idea to clarify the beginning information in the tags for the best results when trying to find bugs and errors.</p>
<p>Within the body of the page a lot of the information can be sorted into different sections. In order to seperate the content you will need to use something called div tags. A div tag can easily break apart seperate sections of the page and will help you style your page in the future.</p>
<blockquote><p>&lt;div id=”header”&gt;<br />
&lt;h1&gt;The Empty Headed Blog&lt;/h1&gt;<br />
&lt;/div&gt;</p></blockquote>
<p>Note that it is possible to contain divs inside of divs.</p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=164&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://codewithdesign.com/2009/10/12/into-to-html-creating-a-basic-web-page/' rel='bookmark' title='Permanent Link: Into to HTML: Creating A Basic Web Page'>Into to HTML: Creating A Basic Web Page</a></li>
<li><a href='http://codewithdesign.com/2009/09/30/intro-to-html-css-creating-a-style-sheet/' rel='bookmark' title='Permanent Link: Intro to HTML: CSS Creating a Style Sheet'>Intro to HTML: CSS Creating a Style Sheet</a></li>
<li><a href='http://codewithdesign.com/2009/10/04/creating-a-single-page-login-%e2%80%93-design-view/' rel='bookmark' title='Permanent Link: Creating a Single Page login – Design View'>Creating a Single Page login – Design View</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2009/11/16/into-to-html-creating-a-basic-web-page-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Going Through Website Creation Part 1: Layout</title>
		<link>http://codewithdesign.com/2009/11/13/going-through-website-creation-part-1-layout/</link>
		<comments>http://codewithdesign.com/2009/11/13/going-through-website-creation-part-1-layout/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 19:25:59 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[create]]></category>
		<category><![CDATA[creation]]></category>
		<category><![CDATA[feed]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[include]]></category>
		<category><![CDATA[layout]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[skorg]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=151</guid>
		<description><![CDATA[A few months ago I posted an old project on the old blog. The project was entitled “Browser Friendly Feed Reader.” This project consisted of three simple pages. The first was the submitting form where users could enter their rss or xml feed. The contents of this feed could be output in the web browser to displaying it inside of the site framework that was created.


Related posts:<ol><li><a href='http://codewithdesign.com/2010/03/26/going-through-website-creation-part-2-backend/' rel='bookmark' title='Permanent Link: Going through website creation part 2: Backend'>Going through website creation part 2: Backend</a></li>
<li><a href='http://codewithdesign.com/2009/12/22/easyworks-a-new-php-front-end-framework/' rel='bookmark' title='Permanent Link: Easyworks a new PHP front end framework'>Easyworks a new PHP front end framework</a></li>
<li><a href='http://codewithdesign.com/2010/05/18/recycle-pages-by-splitting-your-website-into-pieces-with-php/' rel='bookmark' title='Permanent Link: Recycle pages by splitting your website into pieces with PHP'>Recycle pages by splitting your website into pieces with PHP</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style = 'float:left; margin-right:5px;'>            <a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-text="Going Through Website Creation Part 1: Layout" data-via="" data-url="http://codewithdesign.com/2009/11/13/going-through-website-creation-part-1-layout/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><g:plusone size="tall" href="http://codewithdesign.com/2009/11/13/going-through-website-creation-part-1-layout/"></g:plusone><h2>Starting Up An Old Project</h2>
<div id="content_div-141">
<p>A few months ago I posted an old project on the old blog. The project was entitled “<a href="http://rss.skorg.org/">Browser Friendly Feed Reader.</a>” This project consisted of three simple pages. The first was the submitting form where users could enter their rss or xml feed. The contents of this feed could be output in the web browser to displaying it inside of the site framework that was created.</p>
<p><a rel="lightbox[141]" href="../wp-content/uploads/2009/11/rss_skorg_atchison.jpg"><img title="rss_skorg_atchison" src="../wp-content/uploads/2009/11/rss_skorg_atchison.jpg" alt="rss_skorg_atchison" width="490" height="453" /></a></p>
<p><strong>Process.php<br />
Forum.php<br />
View.php</strong></p>
<p>The site was very simple but it was more built for the idea behind viewing a feed in the browser. Since then I wanted to create a more advanced version of the site that relied on a database and the ability to subscribe to the feeds. This is when I decided to restart to the old project and completely rework how everything is set from the ground up.</p>
<h2>Working With The Framework</h2>
<h2><a href="http://codewithdesign.com/wp-content/uploads/2009/11/framework.jpg" rel="lightbox[151]"><img class="alignnone size-full wp-image-152" title="framework" src="http://codewithdesign.com/wp-content/uploads/2009/11/framework.jpg" alt="framework" width="540" height="524" /></a></h2>
<p>When starting to create a new project or just recreating one the first thing that you will need is a frame work. The frame work is a quick drawing of how you would like to have everything setup. Some people like to create theirs with programs such as In Design or Illustrator but I prefer to use a graphing set, a notepad and whatever pen is closest to me. I should be using pencil but I normally have a plan in my head prior to starting something.</p>
<p><a rel="lightbox[141]" href="../wp-content/uploads/2009/11/dreamweaver_create_a_page.jpg"><img title="dreamweaver_create_a_page" src="../wp-content/uploads/2009/11/dreamweaver_create_a_page.jpg" alt="dreamweaver_create_a_page" width="582" height="460" /></a></p>
<p>Once you have the general idea of how things are going to work it is a good idea to draw out how you would like to store the key components of a site. I use a notepad throughout the whole process and it usually starts with me laying out something that looks like this.</p>
<h2>Contents of index</h2>
<p><strong>Header</strong> (include not secure page)<br />
Main image<br />
Nav bar (include)<br />
<strong> </strong></p>
<p><strong>Sidebar</strong> (include)<br />
Sidebar components (include single and double width items)<br />
Navigation (include)</p>
<p><strong>Main content</strong> (not included)<br />
Post data</p>
<p><strong>Footer</strong> (include)<br />
Blocks of meta and links (include)<br />
Bottom strip (include)</p>
<h2>Order of Operations When Designing the Index</h2>
<p>Once this has been worked up I then head into Adobe Dreamweaver to begin the process of changing my framework into an actual css ready site with all of the divs. This process takes a fair amount of time and the content usually created in this order. First note that Dreamweaver automatically creates the untitled.php page and the css page. At this point I only have the two items on my testing server. Back to showing you the order of operations.</p>
<ol>
<li>Change the CSS page to create the proper widths for main content, sidebar, and post.</li>
<li>Change padding properties, select fonts, change margin properties.</li>
<li>Create the divs within the untitled document ie the divs in the header that hold link menus.</li>
<li> Add the div id and classes to the CSS file. (remember to work down the content as it appears within your page. Start with the header then go to sidebar, etc.)</li>
<li>Create and fill the pages with fake content and see if this is how you would like the pages to be displayed.</li>
<li>Go through and tweak anything that makes you unhappy.</li>
</ol>
<h2>Pulling Apart the Index.php Page</h2>
<p>Now that you have created your base index page and you are somewhat happy with the content you can go ahead and begin to pull the page apart. This is where the layout of includes will come in handy. This process consists of cutting and pasting section of code into new php files. The naming of these files is up to you but I normally go with “pt_” as a prefix for “Part” which is a part of a page and “pg_” which stands for “Page” meaning that it is a whole page. An example of this is “pg_authors.php” or pg_feeds_addfeed.php” The next section of naming a page comes from the actual section that is within the page. On the friendly browser feed viewer project I started there are sections of pages that relate to feeds. If I wanted to create a page where users could subscribe to a feed I would name it “pg_feed_subscribe” this tells me what the php file is, its subject and what the page is for. Another type of file I often contain is the prefix “process_” This is a page that requires a form to post to or backend piece of date. The page naming is completely up to you I just wanted to share how I go about naming my webpages.</p>
<p>Now we will go through pulling the pages apart. Now that we have gone through a little lesson on proper page names it is now time to actually pull something apart. For this I will not be using the <a href="http://rss.skorg.org/">rss.skorg.org</a> site but a new site with no content instead.</p>
<p><strong>Here is the full index.php page that we will be working with.</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;head&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;title&gt;Test&lt;/title&gt;
&lt;link href=&quot;style.css&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
&lt;!--[if IE 5]&gt;
&lt;style type=&quot;text/css&quot;&gt;
/* place css box model fixes for IE 5* in this conditional comment */
.twoColFixRtHdr #sidebar1 { width: 220px; }
&lt;/style&gt;
&lt;![endif]--&gt;&lt;!--[if IE]&gt;
&lt;style type=&quot;text/css&quot;&gt;
/* place css fixes for all versions of IE in this conditional comment */
.twoColFixRtHdr #sidebar1 { padding-top: 30px; }
.twoColFixRtHdr #mainContent { zoom: 1; }
/* the above proprietary zoom property gives IE the hasLayout it needs to avoid several bugs */
&lt;/style&gt;
&lt;![endif]--&gt;&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;container&quot;&gt;
&lt;div id=&quot;header&quot;&gt;
&lt;h1&gt;Header&lt;/h1&gt;
&lt;!-- end #header --&gt;&lt;/div&gt;
&lt;div id=&quot;sidebar1&quot;&gt;
&lt;h3&gt;Sidebar1 Content&lt;/h3&gt;
&lt;p&gt;The background color on this div will only show for the length of the content. If you'd like a dividing line instead, place a border on the right side of the #mainContent div if it will always contain more content. &lt;/p&gt;
&lt;p&gt;Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque  eget, cursus et, fermentum ut, sapien. Fusce metus mi, eleifend  sollicitudin, molestie id, varius et, nibh. Donec nec libero.&lt;/p&gt;
&lt;!-- end #sidebar1 --&gt;&lt;/div&gt;
&lt;div id=&quot;mainContent&quot;&gt;
&lt;h1&gt; Main Content &lt;/h1&gt;
&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at,  odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. Fusce  varius urna id quam. Sed neque mi, varius eget, tincidunt nec, suscipit id,  libero. In eget purus. Vestibulum ut nisl. Donec eu mi sed turpis feugiat  feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut,  sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh.  Donec nec libero.&lt;/p&gt;
&lt;h2&gt;H2 level heading &lt;/h2&gt;
&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio.&lt;/p&gt;
&lt;!-- end #mainContent --&gt;&lt;/div&gt;
&lt;!-- This clearing element should immediately follow the #mainContent div in order to force the #container div to contain all child floats --&gt;&lt;br /&gt;
&lt;div id=&quot;footer&quot;&gt;
&lt;p&gt;Footer&lt;/p&gt;
&lt;!-- end #footer --&gt;&lt;/div&gt;
&lt;!-- end #container --&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre></td></tr></table></div>

<p>Now we are going to pull this page apart and change some things so the include will work properly. The first thing we are going to want to do is change how the header information is setup. We want the content that can be thrown into one file to stay at the very top. The rest that we need for the page is going to be below that.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;title&gt;Test&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;container&quot;&gt;
&lt;div id=&quot;header&quot;&gt;
&lt;h1&gt;Header&lt;/h1&gt;
&lt;!– end #header –&gt;&lt;/div&gt;</pre></td></tr></table></div>

<p>Take note of where this section of code is and what has changed. The title tags have been moved below the IE exceptions. This is so it is not included in the new “pt_head_req_top.php” file. Now we are going to cut the bottom part of the header code will have a separate required field for the transition tags. This is important so if you wanted to add class to the divs you could do it to everything based on one file change.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pt_head_req_top.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;title&gt;Test&lt;/title&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pt_head_main.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Inside the two sections is where you want the head data that will change for each page. The following code is what pt_head_main.php consists of.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;/head&gt;
&lt;body&gt;
&lt;div id=&quot;container&quot;&gt;
&lt;div id=&quot;header&quot;&gt;
&lt;h1&gt;Header&lt;/h1&gt;
&lt;!-- end #header --&gt;&lt;/div&gt;</pre></td></tr></table></div>

<p>Because we are now pulling sections of the page together with php the load times will be a little bit quicker and we have decreased the code of the index by an incredible amount. The index.php code now looks like this when we are done with it.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pt_head_req_top.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;title&gt;Test&lt;/title&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pt_head_main.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pt_sidebar_main.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;h1&gt; Main Content &lt;/h1&gt;
&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at,  odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. Fusce  varius urna id quam. Sed neque mi, varius eget, tincidunt nec, suscipit id,  libero. In eget purus. Vestibulum ut nisl. Donec eu mi sed turpis feugiat  feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut,  sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh.  Donec nec libero.&lt;/p&gt;
&lt;h2&gt;H2 level heading &lt;/h2&gt;
&lt;p&gt;Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam,  justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam  ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo  porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis  ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean  sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio.&lt;/p&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">include</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'pt_footer_main.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Now you should be able to create a site that is fully based off of your index. If you need to change things around like the css link based on different pages there is always PHP code for things like that.</p>
<p><a href="http://codewithdesign.com/2010/03/26/going-through-website-creation-part-2-backend/">Continue on to read part 2</a></p>
<p>By: Caleb Jonasson</p>
</div>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=151&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://codewithdesign.com/2010/03/26/going-through-website-creation-part-2-backend/' rel='bookmark' title='Permanent Link: Going through website creation part 2: Backend'>Going through website creation part 2: Backend</a></li>
<li><a href='http://codewithdesign.com/2009/12/22/easyworks-a-new-php-front-end-framework/' rel='bookmark' title='Permanent Link: Easyworks a new PHP front end framework'>Easyworks a new PHP front end framework</a></li>
<li><a href='http://codewithdesign.com/2010/05/18/recycle-pages-by-splitting-your-website-into-pieces-with-php/' rel='bookmark' title='Permanent Link: Recycle pages by splitting your website into pieces with PHP'>Recycle pages by splitting your website into pieces with PHP</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2009/11/13/going-through-website-creation-part-1-layout/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Beginners Guide to PHP</title>
		<link>http://codewithdesign.com/2009/09/29/the-beginners-guide-to-php/</link>
		<comments>http://codewithdesign.com/2009/09/29/the-beginners-guide-to-php/#comments</comments>
		<pubDate>Wed, 30 Sep 2009 00:27:27 +0000</pubDate>
		<dc:creator>Caleb Jonasson</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://codewithdesign.com/?p=3</guid>
		<description><![CDATA[TweetThe beginners guide to PHP The first thing that you are going to need to know about PHP is that it is built around HTML. Any PHP page can function the same as an HTML page. So if we were to go and put a head, body and some content in paragraphs you would have [...]


Related posts:<ol><li><a href='http://codewithdesign.com/2009/11/16/into-to-html-creating-a-basic-web-page-2/' rel='bookmark' title='Permanent Link: Into to HTML: Creating A Basic Web Page'>Into to HTML: Creating A Basic Web Page</a></li>
<li><a href='http://codewithdesign.com/2010/12/28/stop-direct-page-access-with-php/' rel='bookmark' title='Permanent Link: Stop Direct Page Access With PHP'>Stop Direct Page Access With PHP</a></li>
<li><a href='http://codewithdesign.com/2009/10/12/into-to-html-creating-a-basic-web-page/' rel='bookmark' title='Permanent Link: Into to HTML: Creating A Basic Web Page'>Into to HTML: Creating A Basic Web Page</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<div style = 'float:left; margin-right:5px;'>            <a href="http://twitter.com/share" class="twitter-share-button" data-count="vertical" data-text="The Beginners Guide to PHP" data-via="" data-url="http://codewithdesign.com/2009/09/29/the-beginners-guide-to-php/" en>Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script></div><g:plusone size="tall" href="http://codewithdesign.com/2009/09/29/the-beginners-guide-to-php/"></g:plusone><p>The beginners guide to PHP</p>
<p>The first thing that you are going to need to know about PHP is that it is built around HTML. Any PHP page can function the same as an HTML page. So if we were to go and put a head, body and some content in paragraphs you would have a successful HTML page being outputted by PHP.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span>My PHP Page<span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>h1<span style="color: #339933;">&gt;</span>The Main Test Page<span style="color: #339933;">&lt;/</span>h1<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;</span>p<span style="color: #339933;">&gt;</span>This is the paragraph<span style="color: #339933;">&lt;/</span>p<span style="color: #339933;">&gt;</span>
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span></pre></td></tr></table></div>

<p>When you run the following lines inside of a PHP script you are essentially just coding in HTML but as a .PHP file.</p>
<p>Anything that you code in PHP must be between the PHP tags. If it is not between the PHP tags the browser will assume that it is HTML and will print out simple text from the browser.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>As you can see there are two different ways to show that the code is PHP. It is more formal among coders to use the first method of opening and closing tags but it is not necessary. It is more or less a way to recognize that the following code is PHP based.</p>
<p>It is always a good idea to properly comment the code that you are working on. This will help people that read your code if you ever need help with it. Also when going back to a project after quite some time you may be forgetful as tow hat variables and sections of the code are doing what. Which leads me to want to talk about assigning variables.</p>
<p>Unlike other programming languages where declaring a variable as an Integer, Boolean, Float, Etc is important and needed to get the program to run.  In PHP you can convert variables to these values but if you wanted to assign a variable with a number or text it only requires an equal sign.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">//this is a comment</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Declaring a variable.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// declaring a variable</span>
<span style="color: #000088;">$pizza</span> <span style="color: #339933;">=</span> “$<span style="color:#800080;">13.99</span>″<span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// printing the variable</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$pizza</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>Notice how the variable has a $ sign on it. All variables must have this dollar sign in front of it in order to be noticed by the server processing the PHP. A variable can contain almost any information that you want and can be called anything, but it is a good idea to name them something that will help you remember them. If you have variables of $q, $h, $ht, $gh and so on. Chances are that you will be ridiculed by someone eventually. You are also going to have issues remembering the code that you have entered.</p>
<p>Functions are a very important part of PHP much like they are for any language. In this next example we are going to create our own function and apply it to some code with a variable and content outputs into a browser.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> roll<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">return</span> <span style="color: #990000;">mt_rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">echo</span> roll<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>As you can see, we have created a rolling dice with PHP. Within this function we included the “mt_rand”, similar to rand but has a more random output then the simple “rand.”<br />
Now we are going to load a variable from the roll function that we have created then output it into the browser.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">function</span> roll<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">return</span> <span style="color: #990000;">mt_rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">1</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$roll1</span> <span style="color: #339933;">=</span> roll<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #b1b100;">echo</span> “you  have rolled a ” <span style="color: #339933;">.</span> <span style="color: #000088;">$roll1</span> <span style="color: #339933;">.</span> “<span style="color: #339933;">,</span> way to go<span style="color: #339933;">!</span>”
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>With this short section of code you first create the function roll. After the function you then load it into the variable roll1. Now you have an output of this roll going to your browser. This output will say for example “ you have rolled a 1, Way to go!”</p>
<img src="http://codewithdesign.com/?ak_action=api_record_view&id=3&type=feed" alt="" />

<p>Related posts:<ol><li><a href='http://codewithdesign.com/2009/11/16/into-to-html-creating-a-basic-web-page-2/' rel='bookmark' title='Permanent Link: Into to HTML: Creating A Basic Web Page'>Into to HTML: Creating A Basic Web Page</a></li>
<li><a href='http://codewithdesign.com/2010/12/28/stop-direct-page-access-with-php/' rel='bookmark' title='Permanent Link: Stop Direct Page Access With PHP'>Stop Direct Page Access With PHP</a></li>
<li><a href='http://codewithdesign.com/2009/10/12/into-to-html-creating-a-basic-web-page/' rel='bookmark' title='Permanent Link: Into to HTML: Creating A Basic Web Page'>Into to HTML: Creating A Basic Web Page</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://codewithdesign.com/2009/09/29/the-beginners-guide-to-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

