<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1044194" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1044194</link>
    <description></description>
    <language>en</language>
          <item>
    <title>teammatt3 wrote:
Isn&#039;t that</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/conditional-include#comment-1242804</link>
    <description> &lt;p&gt;&lt;div class=&quot;quote-msg&quot;&gt;&lt;div class=&quot;quote-author&quot;&gt;&lt;em&gt;teammatt3&lt;/em&gt; wrote:&lt;/div&gt;Isn&#039;t that the definition of &lt;a href=&quot;http://us2.php.net/require&quot;&gt;require&lt;/a&gt;?&lt;/div&gt;It is, but using a PHP E_ERROR halts the script and doesn&#039;t allow for a friendly message, just a white screen.&lt;br /&gt;
Include() only issues an E_WARNING, allowing a message and rest of page, or as my example with an exit.&lt;/p&gt;
&lt;p&gt;Ideally you would include the header/content/footer/navigation etc with a message then exit() if desired, or &quot;other&quot; criteria if the file was not available.&lt;/p&gt;
 </description>
     <pubDate>Sun, 21 Jun 2009 19:20:00 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1242804 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Isn&#039;t that the definition of</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/conditional-include#comment-1242803</link>
    <description> &lt;p&gt;Isn&#039;t that the definition of &lt;a href=&quot;http://us2.php.net/require&quot;&gt;require&lt;/a&gt;? It stops execution of the script if the file isn&#039;t available. &lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;@include &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;wp-content/plugins/stuff.inc&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;might achieve the desired result. The &lt;a href=&quot;http://us3.php.net/manual/en/language.operators.errorcontrol.php&quot;&gt;@ symbol&lt;/a&gt; will suppress the warning that is produced if the file is not available.&lt;/p&gt;
 </description>
     <pubDate>Sun, 21 Jun 2009 19:02:49 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1242803 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Or if you don&#039;t want</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/conditional-include#comment-1242793</link>
    <description> &lt;p&gt;Or if you don&#039;t want anything &quot;at all&quot; to happen if the file is not included and stop the entire page load and rest of script, use this:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if (!include(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;wp-content/plugins/stuff.inc&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)){&lt;br /&gt;exit(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;file not available&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Sun, 21 Jun 2009 14:16:30 +0000</pubDate>
 <dc:creator>greg</dc:creator>
 <guid isPermaLink="false">comment 1242793 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title>Something like</title>
    <link>https://www.webmaster-forums.net/web-programming-and-application-development/conditional-include#comment-1242792</link>
    <description> &lt;p&gt;Something like this:&lt;br /&gt;
&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;$file &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;wp-content/plugins/stuff.inc&quot;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;if (&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;file_exists&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;)) {&lt;br /&gt;&amp;nbsp; include(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$file&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
 </description>
     <pubDate>Sun, 21 Jun 2009 13:14:06 +0000</pubDate>
 <dc:creator>kazimmerman</dc:creator>
 <guid isPermaLink="false">comment 1242792 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
