<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1037267" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1037267</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/can-anybody-tell-me-how-add-php-code-html-file#comment-1213926</link>
    <description> &lt;p&gt;Acturelly, I think the codes are correct, I saved codes as PHP file, uploaded to server, they did work, but if I insert codes into HTML file, they do not work. I think maybe server does support it.&lt;/p&gt;
&lt;p&gt;Line 35 to Line 42&lt;br /&gt;
if ( is_array($arr_xml) ) {&lt;br /&gt;
		echo &quot;\n
&lt;ul&gt;n&quot;;&lt;br /&gt;
		for ($i = 0; $i &amp;lt; count($arr_xml[&#039;URL&#039;]); $i++) {&lt;br /&gt;
			echo &quot;
&lt;li&gt;&quot;.$arr_xml[&#039;BeforeText&#039;][$i].&quot;&lt;br /&gt;
&lt;a href=&quot;%22%22.$arr_xml[%27URL%27][$i].%22/%22&quot;&gt;&quot;.$arr_xml[&#039;Text&#039;][$i].&quot;&lt;/a&gt; &quot;.$arr_xml[&#039;AfterText&#039;][$i].&quot;&lt;/li&gt;
&lt;p&gt;\n&quot;;&lt;br /&gt;
		}&lt;br /&gt;
		echo &quot;&lt;/p&gt;&lt;/ul&gt;
&lt;/p&gt;&lt;p&gt;&quot;;&lt;br /&gt;
	}&lt;/p&gt;
 </description>
     <pubDate>Mon, 22 Jan 2007 21:32:59 +0000</pubDate>
 <dc:creator>rcajht</dc:creator>
 <guid isPermaLink="false">comment 1213926 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/can-anybody-tell-me-how-add-php-code-html-file#comment-1213925</link>
    <description> &lt;p&gt;Whats on line 37 and 38 ?&lt;/p&gt;
&lt;p&gt;the line should either start with echo (or print) or be assigned to a variable: $adcode = &quot;....&lt;/p&gt;
 </description>
     <pubDate>Mon, 22 Jan 2007 21:11:42 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1213925 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/can-anybody-tell-me-how-add-php-code-html-file#comment-1213913</link>
    <description> &lt;p&gt;I tried your code, it indeed works, (shows my IP address), but after I copied Ads codes I got from other website, I got:&lt;/p&gt;
&lt;p&gt;Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in line 39,&lt;/p&gt;
&lt;p&gt;line39:&lt;br /&gt;
&lt;a href=&quot;%22%22.$arr_xml[%27URL%27][$i].%22/%22&quot;&gt;&quot;.$arr_xml[&#039;Text&#039;][$i].&quot;&lt;/a&gt; &quot;.$arr_xml[&#039;AfterText&#039;][$i].&quot;
&lt;/p&gt;&lt;p&gt;\n&quot;;&lt;/p&gt;
&lt;p&gt;do I need to modify .htaccess file?&lt;/p&gt;
&lt;p&gt;by the way, if I delete .htaccess file, I can not open my page, always ask &quot;............... save file?&quot;,&lt;br /&gt;
can anybody tell me why, there was not .htaccess file several weeks ago, my website even runed good.&lt;/p&gt;
 </description>
     <pubDate>Mon, 22 Jan 2007 19:35:33 +0000</pubDate>
 <dc:creator>rcajht</dc:creator>
 <guid isPermaLink="false">comment 1213913 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/can-anybody-tell-me-how-add-php-code-html-file#comment-1213849</link>
    <description> &lt;p&gt;Thanks Greg, I will try your method Monday.&lt;/p&gt;
 </description>
     <pubDate>Sun, 21 Jan 2007 16:05:36 +0000</pubDate>
 <dc:creator>rcajht</dc:creator>
 <guid isPermaLink="false">comment 1213849 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/can-anybody-tell-me-how-add-php-code-html-file#comment-1213846</link>
    <description> &lt;p&gt;Most of the time, you can&#039;t. You must first change the HTML file over to a PHP file by changing it&#039;s extention from .html to .php  Then to add the php code, you just wrap it in PHP tags within your original code.  PHP tags are either &amp;lt;?  ?&amp;gt;  or &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;&amp;nbsp; &lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;  depending on server settings. &lt;/p&gt;
&lt;p&gt;Example...&lt;/p&gt;
&lt;p&gt;Original file (testfile.html)&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Test Page&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h2&amp;gt;Welcome to my test page&amp;lt;/h2&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Add Php to it and rename it  (testfile.php)&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Test Page&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;h2&amp;gt;Welcome to my test page&amp;lt;/h2&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;We have detected you are accessing this page from&lt;br /&gt;&amp;nbsp;&amp;nbsp; &amp;lt;? &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo $_SERVER[&amp;#039;REMOTE_ADDR&amp;#039;];&lt;br /&gt;&amp;nbsp;&amp;nbsp; ?&amp;gt;&lt;br /&gt;&amp;lt;/p&amp;gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/div&gt;&lt;/p&gt;
&lt;p&gt;Some notes: &lt;/p&gt;
&lt;p&gt;1. Technically it is possible to use the orignal .html file for PHP code if your server is set up to do so. Most are not though.&lt;/p&gt;
&lt;p&gt;2. For the example I used, just sending a variable to the output, you can use the following shortcut instead&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;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= echo &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_SERVER&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;REMOTE_ADDR&#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;-Greg&lt;/p&gt;
 </description>
     <pubDate>Sun, 21 Jan 2007 15:17:55 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1213846 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
