<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1018730" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1018730</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/increments#comment-1110678</link>
    <description> &lt;p&gt;&lt;code&gt;print DB (&amp;quot;$i++\n&amp;quot;);&lt;/code&gt;&#039; is equal to $i . &quot;++\n&quot;&lt;br /&gt;
even if it were not a string and did increment $i, you&#039;re using the post-increment operator and it would increment AFTER it printed.&lt;/p&gt;
&lt;p&gt;try this:&lt;br /&gt;
&lt;code&gt;print DB ++$i . &amp;quot;\n&amp;quot;;&lt;/code&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Sat, 22 Jun 2002 01:36:39 +0000</pubDate>
 <dc:creator>ROB</dc:creator>
 <guid isPermaLink="false">comment 1110678 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/increments#comment-1110513</link>
    <description> &lt;p&gt;thx&lt;/p&gt;
 </description>
     <pubDate>Tue, 18 Jun 2002 21:38:02 +0000</pubDate>
 <dc:creator>brady.k</dc:creator>
 <guid isPermaLink="false">comment 1110513 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/increments#comment-1110509</link>
    <description> &lt;p&gt;I&#039;ve just woken up and my brain is in half rotation, but try this code..&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;#!/usr/local/bin/perl&lt;br /&gt;&lt;br /&gt;	use CGI;&lt;br /&gt;	my $query = CGI-&amp;gt;new();&lt;br /&gt;&lt;br /&gt;	&lt;br /&gt;	my $db = &amp;quot;/home/data/user.txt&amp;quot;;&lt;br /&gt;&lt;br /&gt;	open(DB, $db);&lt;br /&gt;		chomp($current_hits = &amp;lt;DB&amp;gt;);&lt;br /&gt;	close(DB);&lt;br /&gt;	$current_hits++;&lt;br /&gt;	open(DB, &amp;quot;&amp;gt;$db&amp;quot;);&lt;br /&gt;	print DB &amp;quot;$current_hits\n&amp;quot;;&lt;br /&gt;	foreach $key (sort keys(%ENV)) { &lt;br /&gt;		print DB &amp;quot;$key = $ENV{$key}\n&amp;quot;; &lt;br /&gt;	} &lt;br /&gt;	close(DB);&lt;br /&gt;	&lt;br /&gt;	my $url = &amp;quot;http://bradyhouse.hypermart.net/home.html&amp;quot;;&lt;br /&gt;&lt;br /&gt;	print $query-&amp;gt;redirect(&amp;quot;$url&amp;quot;);&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
 </description>
     <pubDate>Tue, 18 Jun 2002 21:12:33 +0000</pubDate>
 <dc:creator>zollet</dc:creator>
 <guid isPermaLink="false">comment 1110509 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/increments#comment-1110496</link>
    <description> &lt;p&gt;Nah. This won&#039;t work.&lt;/p&gt;
&lt;p&gt;First off you don&#039;t initialize the variable $i to be incremented, and then you don&#039;t store it anywhere so Perl doesn&#039;t know what it was left at to increment it for the next visitor.&lt;/p&gt;
&lt;p&gt;The easiest way to solve this be to create another file just with a number stored in it, and then create a sub to fetch the number, increment it and print it back to the file. This will work as your counter, then.&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
 </description>
     <pubDate>Tue, 18 Jun 2002 18:18:10 +0000</pubDate>
 <dc:creator>Wil</dc:creator>
 <guid isPermaLink="false">comment 1110496 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/increments#comment-1110483</link>
    <description> &lt;p&gt;ok..i have a code that takes the env vars and places them in a db (flatfile):&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;#!/usr/local/bin/perl&lt;br /&gt;&lt;br /&gt;	use CGI;&lt;br /&gt;	my $query = CGI-&amp;gt;new();&lt;br /&gt;&lt;br /&gt;	&lt;br /&gt;	my $db = &amp;quot;/home/data/user.txt&amp;quot;;&lt;br /&gt;&lt;br /&gt;	&lt;br /&gt;	open (DB,&amp;quot;&amp;gt;&amp;gt;$db&amp;quot;);&lt;br /&gt;	print DB (&amp;quot;$i++\n&amp;quot;);&lt;br /&gt;	foreach $key (sort keys(%ENV)) { &lt;br /&gt;		print DB (&amp;quot;$key = $ENV{$key}\n&amp;quot;); &lt;br /&gt;	} &lt;br /&gt;	print DB (&amp;quot;\n&amp;quot;);&lt;br /&gt;	close DB;&lt;br /&gt;&lt;br /&gt;	&lt;br /&gt;	my $url = &amp;quot;http://bradyhouse.hypermart.net/home.html&amp;quot;;&lt;br /&gt;&lt;br /&gt;	print $query-&amp;gt;redirect(&amp;quot;$url&amp;quot;);&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;i added the &lt;code&gt;print DB (&amp;quot;$i++\n&amp;quot;);&lt;/code&gt;&#039;, thinking for the first person, it would add the number 1 infront of the env vars....and the second person would be 2 and so on...but it doesnt work, it only prints &lt;code&gt;++&lt;/code&gt;&#039; in front of the env vars&lt;/p&gt;
&lt;p&gt;it is sort of a hit counter....just something that i want to see how many people come, and which visitor had what stats...&lt;/p&gt;
 </description>
     <pubDate>Tue, 18 Jun 2002 15:41:05 +0000</pubDate>
 <dc:creator>brady.k</dc:creator>
 <guid isPermaLink="false">comment 1110483 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/server-side-scripting/increments#comment-1110457</link>
    <description> &lt;p&gt;++ to the top of what?&lt;br /&gt;
are you making a hit counter type thing? is the results being written to file or database?&lt;br /&gt;
whats the code segment?&lt;/p&gt;
 </description>
     <pubDate>Mon, 17 Jun 2002 22:05:02 +0000</pubDate>
 <dc:creator>Busy</dc:creator>
 <guid isPermaLink="false">comment 1110457 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
