<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1023716" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1023716</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/counter-frustrations#comment-1145546</link>
    <description> &lt;p&gt;Just a passing thought...&lt;/p&gt;
&lt;p&gt;I was wondering if running a short shell script would be more efficient than using two file handles for a text counter.  The first handle to read the contents (required to increment the unknown number).  The second to record the new number.&lt;/p&gt;
&lt;p&gt;It just seemed like a waste to me that two handles should be required for a single task (incrementing an unknown number).  Especially when we don&#039;t need the number (I&#039;m assuming the number won&#039;t be displayed on the page).&lt;/p&gt;
&lt;p&gt;So, I made a short shell script.  I haven&#039;t benched it.  It was just something to occupy 5 minutes of my time (spent writting this post).&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;cat sample.php | awk &amp;#039;{printf &amp;quot;%d\n&amp;quot;, ($0+1);}&amp;#039; &amp;gt; sample.php&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Wed, 11 Feb 2004 06:56:21 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1145546 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/counter-frustrations#comment-1145509</link>
    <description> &lt;p&gt;I made my own &lt;a href=&quot;http://chengeu.krayup.com/index.php?page=phpcode&quot; class=&quot;bb-url&quot;&gt;PHP counter&lt;/a&gt; code, if you want, you can use that or see how that works and try fixing your version of the code with it...&lt;/p&gt;
 </description>
     <pubDate>Tue, 10 Feb 2004 19:29:54 +0000</pubDate>
 <dc:creator>Renegade</dc:creator>
 <guid isPermaLink="false">comment 1145509 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/counter-frustrations#comment-1145508</link>
    <description> &lt;p&gt;Well, I managed to figure out the problem just as I checked back on the boards. It was the html/php extension problem.&lt;/p&gt;
&lt;p&gt;I know the simple text counters are very inaccurate (the refresh/increment issue). I currently have a book on php that I am reading thru and just wanted to see some of the syntax in working order.&lt;/p&gt;
&lt;p&gt;Thanks for the input all!!!!&lt;/p&gt;
 </description>
     <pubDate>Tue, 10 Feb 2004 19:28:15 +0000</pubDate>
 <dc:creator>mjs416</dc:creator>
 <guid isPermaLink="false">comment 1145508 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/counter-frustrations#comment-1145507</link>
    <description> &lt;p&gt;The code you provided needs to go into a &lt;strong&gt;&lt;em&gt;.PHP&lt;/em&gt;&lt;/strong&gt; file, not an &lt;em&gt;&lt;strong&gt;.HTML&lt;/strong&gt;&lt;/em&gt; file.&lt;/p&gt;
&lt;p&gt;PHP commands will not get processed unless they are in a file with an extention of .PHP (or another extension the server is set to procees, which usually doesn&#039;t include .html files)&lt;/p&gt;
&lt;p&gt;Try renaming it to counter.php and then calling that page. Also, to avoid confusion later, I would use something like &quot;sample.data&quot;, as the file (from the example you gave) does not actually contain php code, but just a numeric value. This may down the road help determine what files are what in the directory.&lt;/p&gt;
&lt;p&gt;Just in case the page you got this code from didn&#039;t warn you, this type of counter, while very basic, will tend to be very inacurate. If it is on you home page, each time i go to the home page it increases (so if i go to a subpage, then come back to home, it registers another hit). Also someone could sit on the page and jsut keep hitting RELOAD/REFRESH to increase it.&lt;/p&gt;
&lt;p&gt;IMO, if you seriously need a counter, it&#039;s worth to pay the small fee places like thecounter.com charge for a counter.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;-Greg&lt;/p&gt;
 </description>
     <pubDate>Tue, 10 Feb 2004 19:21:34 +0000</pubDate>
 <dc:creator>Greg K</dc:creator>
 <guid isPermaLink="false">comment 1145507 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/counter-frustrations#comment-1145506</link>
    <description> &lt;p&gt;you can&#039;t parse php in a .html file -- name the page counter.php and try again? The php should NOT appear.&lt;/p&gt;
 </description>
     <pubDate>Tue, 10 Feb 2004 19:13:47 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1145506 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
