[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] invisible counter doesn't work
- Subject: Re: [cobalt-users] invisible counter doesn't work
- From: "Steven Werby" <steven-lists@xxxxxxxxxxxx>
- Date: Thu Jul 27 22:31:13 2000
Jeff Lasman <jblists@xxxxxxxxxxxxx> wrote:
> Well, I always thought I could make any cgi script work <frown>.
Ah, perception is not reality. ;-)
> I'm trying count.cgi from "http://www.shavenferret.com/scripts/.
I've used it. It's on one of my servers.
> It works (when called from an .shtml file). but it gives me an error on
> the screen every time it works <frown>.
I tried to duplicate your error. It works fine when $visible = 1. When
$visible = 0 or is commented out, the browser displays an internal server
(500) error.
> Anyone know why?
I'm far from being a Perl programmer, but I'm an excellent Perl hacker. PHP
is for programming, Perl is for hacking. I added the following to the
bottom of count.cgi and it works fine. Delete lines 64-67 and replace them
with:
print "Content-type: text/html\n\n";
if ($visible) { print "$count"; }
> Or have an invisible counter I can use?
I prefer PHP to the overhead of a Perl CGI. YMMV. If you have PHP
installed, a short PHP script could be used to write to a text file and
increment a value whenever the page is viewed. Alternately, you could write
to a MySQL DB. I could definitely whip up something for you pretty quickly,
customized for your needs. On one of my sites I use PHP, MySQL and Apache
environment variables to track clickthroughs on hyperlinks by timestamp, IP
address, href and referring page which is useful for analyzing and reporting
user behavior, link placement and link effectiveness in order to test the
effectiveness of hyperlinked elements and make informed decisions to
optimize the site.
Steven Werby {steven-lists@xxxxxxxxxxxx}