<?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>Marc Fraser &#124; A Blog about all things &#187; php include</title>
	<atom:link href="http://www.marcfraser.co.uk/tag/php-include/feed" rel="self" type="application/rss+xml" />
	<link>http://www.marcfraser.co.uk</link>
	<description>A blog about all things personal, web related.</description>
	<lastBuildDate>Fri, 23 Apr 2010 13:50:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>PHP Include</title>
		<link>http://www.marcfraser.co.uk/php-include-62.htm</link>
		<comments>http://www.marcfraser.co.uk/php-include-62.htm#comments</comments>
		<pubDate>Sat, 10 Oct 2009 10:32:26 +0000</pubDate>
		<dc:creator>Marc</dc:creator>
				<category><![CDATA[PHP Tutorials]]></category>
		<category><![CDATA[php include]]></category>

		<guid isPermaLink="false">http://marcfraser.co.uk/?p=62</guid>
		<description><![CDATA[(from Full Article)
The include command can save you a lot of time as you can create a header, place it in a file and just include that file on every page and the header will be shown. This will also mean that you do not need to edit every page every time you need to [...]]]></description>
			<content:encoded><![CDATA[<p><strong><em><strong><em><a href="../introduction-to-php-tutorial-9.htm">(from Full Article)</a></em></strong></em></strong></p>
<p>The <a href="http://us.php.net/manual/en/function.include.php">include command</a> can save you a lot of time as you can create a header, place it in a file and just include that file on every page and the header will be shown. This will also mean that you do not need to edit every page every time you need to edit your header!</p>
<p>Basically the PHP Include command takes the file name and inserts the contents of the file into the script.</p>
<p>To illustrate this, I will use an example:</p>
<ol>
<li>Create a HTML file called Menu.html and insert the following code into it:</li>
</ol>
<pre class="brush: xml;">&lt;ul&gt;

&lt;li&gt;Home&lt;/li&gt;

&lt;li&gt;Articles&lt;/li&gt;

&lt;li&gt;Tutorial&lt;/li&gt;

&lt;/ul&gt;</pre>
<ol>
<li>Now create a menu_example.php PHP file (in the same directory as Menu.html) and insert:</li>
</ol>
<pre class="brush: php;">&lt;?php

include(‘Menu.html’);

?&gt;</pre>
<ol>
<li>Navigate to menu_example.php in your browser and run it – you should see:</li>
</ol>
<div>
<dl id="attachment_11" style="width: 146px;">
<dt><img title="Menu Example" src="http://marcfraser.co.uk/wp-content/uploads/2009/10/Picture-2.png" alt="Shows the menu that is being included." width="136" height="72" /></dt>
<dd>Menu Included.</dd>
</dl>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.marcfraser.co.uk/php-include-62.htm/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
