<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.3" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: HTML to PHP Template</title>
	<link>http://askmichel.icoder.com/2006/07/15/html-to-php-template/</link>
	<description>i Code to help you profit!</description>
	<pubDate>Sat, 22 Nov 2008 05:12:17 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.3</generator>

	<item>
		<title>by: Nancy P Redford&#8217;s Practical Marketing Tips &#187; Sone Of The Best Scripts In Life Are FREE!</title>
		<link>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-27</link>
		<pubDate>Sat, 12 Aug 2006 11:41:09 +0000</pubDate>
		<guid>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-27</guid>
					<description>[...] P.S.Michel has an excellent tip for those of us who have loads of articles on HTML format that need to converted into php pages quickly and easily. It requires setting up .htacess to run the php script. Read more here [...]</description>
		<content:encoded><![CDATA[<p>[&#8230;] P.S.Michel has an excellent tip for those of us who have loads of articles on HTML format that need to converted into php pages quickly and easily. It requires setting up .htacess to run the php script. Read more here [&#8230;]
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: gann_144</title>
		<link>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-20</link>
		<pubDate>Sun, 30 Jul 2006 18:39:34 +0000</pubDate>
		<guid>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-20</guid>
					<description>Michel...it worked like a charm. Thank you so much! At first it didnt work but I noticed (or I should say assumed) that you made a typo mistake in the following:

RewriteRule \\.(html?&amp;#124;php&amp;#124;txt) index.php [L]

I changed it to:

RewriteRule \.(html?&amp;#124;php&amp;#124;txt) index.php [L]

Then it worked perfectly!

Thanks Michel.</description>
		<content:encoded><![CDATA[<p>Michel&#8230;it worked like a charm. Thank you so much! At first it didnt work but I noticed (or I should say assumed) that you made a typo mistake in the following:</p>
<p>RewriteRule \\.(html?|php|txt) index.php [L]</p>
<p>I changed it to:</p>
<p>RewriteRule \.(html?|php|txt) index.php [L]</p>
<p>Then it worked perfectly!</p>
<p>Thanks Michel.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: michel</title>
		<link>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-19</link>
		<pubDate>Sun, 30 Jul 2006 17:48:11 +0000</pubDate>
		<guid>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-19</guid>
					<description>Hi gann,

What would you like to see when you go directly to the directory?

1) You could upload yet another file (for example, &lt;code&gt;default.html&lt;/code&gt;) with a home page of your directory:
------------------------------------
This is the article directory
------------------------------------

2) Then make small changes of the &lt;code&gt;index.php&lt;/code&gt; like below:
------------------------------------
$HEADER_FILE = &quot;header.html&quot;;
$FOOTER_FILE = &quot;footer.html&quot;;
$DEFAULT_FILE = &quot;default.html&quot;;
$CONTENTS_FILE = basename(getenv(&quot;REQUEST_URI&quot;));

// show the Header
readfile($HEADER_FILE);

// show the Contents
if (file_exists($CONTENTS_FILE)) {
  readfile($CONTENTS_FILE);
} else {
  readfile($DEFAULT_FILE);
}

// show the Footer
readfile($FOOTER_FILE);
exit;
------------------------------------

3) In order to use this solution with &lt;code&gt;.html&lt;/code&gt;, &lt;code&gt;.php&lt;/code&gt;, and &lt;code&gt;.txt&lt;/code&gt; files use &lt;code&gt;.htaccess&lt;/code&gt; like this:
------------------------------------
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule \.(html?&amp;#124;php&amp;#124;txt)  index.php [L]
------------------------------------

I hope his helps.</description>
		<content:encoded><![CDATA[<p>Hi gann,</p>
<p>What would you like to see when you go directly to the directory?</p>
<p>1) You could upload yet another file (for example, <code>default.html</code>) with a home page of your directory:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
This is the article directory<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>2) Then make small changes of the <code>index.php</code> like below:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
$HEADER_FILE = &#8220;header.html&#8221;;<br />
$FOOTER_FILE = &#8220;footer.html&#8221;;<br />
$DEFAULT_FILE = &#8220;default.html&#8221;;<br />
$CONTENTS_FILE = basename(getenv(&#8221;REQUEST_URI&#8221;));</p>
<p>// show the Header<br />
readfile($HEADER_FILE);</p>
<p>// show the Contents<br />
if (file_exists($CONTENTS_FILE)) {<br />
  readfile($CONTENTS_FILE);<br />
} else {<br />
  readfile($DEFAULT_FILE);<br />
}</p>
<p>// show the Footer<br />
readfile($FOOTER_FILE);<br />
exit;<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>3) In order to use this solution with <code>.html</code>, <code>.php</code>, and <code>.txt</code> files use <code>.htaccess</code> like this:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
RewriteEngine On<br />
RewriteCond %{REQUEST_FILENAME} -f<br />
RewriteRule \.(html?|php|txt)  index.php [L]<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>I hope his helps.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: gann_144</title>
		<link>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-18</link>
		<pubDate>Sun, 30 Jul 2006 14:45:11 +0000</pubDate>
		<guid>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-18</guid>
					<description>One more thing, is it correct to add the following 3 lines of code in the .htaccess file so that different file extensions will work with the template. Since I have different file types I added the following 3 lines of code.

  RewriteRule \.htm?   index.php [L]
  RewriteRule \.php?   index.php [L]
  RewriteRule \.txt?   index.php[L]

Sorry for all the trouble I am putting you thru.</description>
		<content:encoded><![CDATA[<p>One more thing, is it correct to add the following 3 lines of code in the .htaccess file so that different file extensions will work with the template. Since I have different file types I added the following 3 lines of code.</p>
<p>  RewriteRule \.htm?   index.php [L]<br />
  RewriteRule \.php?   index.php [L]<br />
  RewriteRule \.txt?   index.php[L]</p>
<p>Sorry for all the trouble I am putting you thru.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: gann_144</title>
		<link>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-17</link>
		<pubDate>Sun, 30 Jul 2006 14:37:25 +0000</pubDate>
		<guid>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-17</guid>
					<description>Sorry...I forgot to mention that my file extensions are named &quot;.php&quot;. Using file extensions &quot;.html&quot; I get a blank page when going directly to the directory.</description>
		<content:encoded><![CDATA[<p>Sorry&#8230;I forgot to mention that my file extensions are named &#8220;.php&#8221;. Using file extensions &#8220;.html&#8221; I get a blank page when going directly to the directory.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: gann_144</title>
		<link>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-16</link>
		<pubDate>Sun, 30 Jul 2006 14:25:46 +0000</pubDate>
		<guid>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-16</guid>
					<description>Michel, I have one small problem with this script. I am experimenting with and I like the concept except for one issue I am having with it. 

If you go directly to a page for example &quot;www.yoursite.com/directory/article1.html&quot;
it works correctly. But if you go directly to the directory for example 
&quot;www.yoursite.com/directory&quot; the template shows but in the content area I get a message like 

&quot;Warning: readfile(directory): failed to open stream: No such file or directory in /home/content/user/html/directory/index.php on line 10&quot;

How can the script be adjusted so that when someone goes straight to the directory instead of a particular file, that the above message does not show up in the content area? Is there a line of code that I can put in the .htaccess file?</description>
		<content:encoded><![CDATA[<p>Michel, I have one small problem with this script. I am experimenting with and I like the concept except for one issue I am having with it. </p>
<p>If you go directly to a page for example &#8220;www.yoursite.com/directory/article1.html&#8221;<br />
it works correctly. But if you go directly to the directory for example<br />
&#8220;www.yoursite.com/directory&#8221; the template shows but in the content area I get a message like </p>
<p>&#8220;Warning: readfile(directory): failed to open stream: No such file or directory in /home/content/user/html/directory/index.php on line 10&#8243;</p>
<p>How can the script be adjusted so that when someone goes straight to the directory instead of a particular file, that the above message does not show up in the content area? Is there a line of code that I can put in the .htaccess file?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: gann_144</title>
		<link>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-15</link>
		<pubDate>Fri, 28 Jul 2006 15:21:15 +0000</pubDate>
		<guid>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-15</guid>
					<description>Thanks Michel, it works great!</description>
		<content:encoded><![CDATA[<p>Thanks Michel, it works great!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: michel</title>
		<link>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-14</link>
		<pubDate>Fri, 28 Jul 2006 10:30:26 +0000</pubDate>
		<guid>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-14</guid>
					<description>Hi gann,

Yes, sure. You can use any page-layout with your &lt;code&gt;header.html&lt;/code&gt; template.
This example below uses a html-table layout.

&lt;div style=&quot;border:1px solid silver; background-color:#f0f0f0;&quot;&gt;&lt;code&gt;&amp;#60;html&amp;#62;&amp;#60;body&amp;#62;
&lt;span style=&quot;color:gray;&quot;&gt;&amp;#60;!-- BEGIN HEADER --&amp;#62;&lt;/span&gt;
&amp;#60;img src=&quot;...&quot; title=&quot;My common header image&quot;&amp;#62;
&amp;#60;h1&amp;#62;COMMON HEADER TITLE&amp;#60;/h1&amp;#62;
&lt;span style=&quot;color:gray;&quot;&gt;&amp;#60;!-- END HEADER --&amp;#62;&lt;/span&gt;
&amp;#60;table&amp;#62;&amp;#60;tr&amp;#62;&amp;#60;td width=&quot;100&quot; valign=&quot;top&quot;&amp;#62;
&lt;span style=&quot;color:gray;&quot;&gt;&amp;#60;!-- BEGIN SIDEBAR --&amp;#62;&lt;/span&gt;
MENU
&amp;#60;li&amp;#62;Menu Item 1&amp;#60;/li&amp;#62;
&amp;#60;li&amp;#62;Menu Item 2&amp;#60;/li&amp;#62;
...
&lt;span style=&quot;color:gray;&quot;&gt;&amp;#60;!-- END SIDEBAR --&amp;#62;&lt;/span&gt;
&amp;#60;/td&amp;#62;&amp;#60;td&amp;#62;
&lt;span style=&quot;color:gray;&quot;&gt;&amp;#60;!-- BEGIN ARTICLE --&amp;#62;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;</description>
		<content:encoded><![CDATA[<p>Hi gann,</p>
<p>Yes, sure. You can use any page-layout with your <code>header.html</code> template.<br />
This example below uses a html-table layout.</p>
<div style="border:1px solid silver; background-color:#f0f0f0;"><code>&lt;html&gt;&lt;body&gt;<br />
<span style="color:gray;">&lt;!-- BEGIN HEADER --&gt;</span><br />
&lt;img src="..." title="My common header image"&gt;<br />
&lt;h1&gt;COMMON HEADER TITLE&lt;/h1&gt;<br />
<span style="color:gray;">&lt;!-- END HEADER --&gt;</span><br />
&lt;table&gt;&lt;tr&gt;&lt;td width="100" valign="top"&gt;<br />
<span style="color:gray;">&lt;!-- BEGIN SIDEBAR --&gt;</span><br />
MENU<br />
&lt;li&gt;Menu Item 1&lt;/li&gt;<br />
&lt;li&gt;Menu Item 2&lt;/li&gt;<br />
...<br />
<span style="color:gray;">&lt;!-- END SIDEBAR --&gt;</span><br />
&lt;/td&gt;&lt;td&gt;<br />
<span style="color:gray;">&lt;!-- BEGIN ARTICLE --&gt;</span></code></div>
]]></content:encoded>
				</item>
	<item>
		<title>by: gann_144</title>
		<link>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-13</link>
		<pubDate>Fri, 28 Jul 2006 02:20:43 +0000</pubDate>
		<guid>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-13</guid>
					<description>Can a sidebar like a Navigation/menu be incorporated into this script?</description>
		<content:encoded><![CDATA[<p>Can a sidebar like a Navigation/menu be incorporated into this script?
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: gann_144</title>
		<link>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-12</link>
		<pubDate>Wed, 26 Jul 2006 01:03:46 +0000</pubDate>
		<guid>http://askmichel.icoder.com/2006/07/15/html-to-php-template/#comment-12</guid>
					<description>Thanks Michel...now it makes sense to me on how it works. :-)</description>
		<content:encoded><![CDATA[<p>Thanks Michel&#8230;now it makes sense to me on how it works. <img src='http://askmichel.icoder.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
