<?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>NewSourceMedia Blog &#187; HP Include</title>
	<atom:link href="http://newsourcemedia.com/blog/tag/hp-include/feed/" rel="self" type="application/rss+xml" />
	<link>http://newsourcemedia.com/blog</link>
	<description>Focused on Interactive Design, Development and Marketing</description>
	<lastBuildDate>Fri, 30 Dec 2011 04:30:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>PHP Include and Require Functions</title>
		<link>http://newsourcemedia.com/blog/php-include-and-require-functions/</link>
		<comments>http://newsourcemedia.com/blog/php-include-and-require-functions/#comments</comments>
		<pubDate>Sat, 28 Feb 2004 00:22:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CMS]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[HP Include]]></category>
		<category><![CDATA[include]]></category>
		<category><![CDATA[include function]]></category>
		<category><![CDATA[PHP include function]]></category>
		<category><![CDATA[PHP include statment]]></category>
		<category><![CDATA[PHP Require]]></category>

		<guid isPermaLink="false">http://newsourcemedia.com/blog/2004/02/27/php-include-and-require-functions/</guid>
		<description><![CDATA[Speed up your developing by using PHP include() and require() functions. Learn how to include multiple files into one PHP file and learn why this is useful in this short lesson. Introduction: With PHP, there are two ways to include &#8230; <a href="http://newsourcemedia.com/blog/php-include-and-require-functions/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[Speed up your developing by using PHP include() and require() functions. Learn how to include multiple files into one PHP file and learn why this is useful in this short lesson.
<span id="more-216"></span>

<span class="contitle">Introduction:</span>

With PHP, there are two ways to include a file. There is                        the <strong>include()</strong> statement and the <strong>require()</strong> statement. Both constructs are very similar except on how                        they handle failures. <strong>Include()</strong> produces                        a Warning while <strong>require()</strong> results in a                        Fatal Error.

I prefer to not to use the <strong>require()</strong> statement,                        because if there's an error, the rest of the page will not                        be displayed. Include() does not behave this way,                        the script will continue regardless and all of the other                        code will be executed.

When a file is included, any variables available at that                        line in the calling file will be available within the called                        file, from that point forward. For example, you may want                        to store all of your php functions or database username                        and passwords into a file called "inc_funct.php"                        and have all the other pages include it. This will save                        you the headache of having to retype the code over and over                        again.
<p class="contitle">
Source PHP Code:

<p class="sourceCODE">&lt;?
// include a file.
include('inc_info.php');
// display the value of the included file.
echo $password;
?&gt;
<p class="contitle">Source PHP Code of Included File (inc_info.php):</p>

<p class="sourceCODE">&lt;?
$password = "1234";
?&gt;

<p class="contitle">
Conclusion:
<p class="content">Just be sure to properly type the path                        to your file. Note, if you're including files that are in                       higher directories (parent directories), it's best to                        type out the full path name starting from the home directory                        (ex: home/user/public/file.php).</p>]]></content:encoded>
			<wfw:commentRss>http://newsourcemedia.com/blog/php-include-and-require-functions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
