homepage Welcome to WebmasterWorld Guest from 54.242.126.9
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
Forum Library, Charter, Moderators: coopster & jatar k & phranque

Perl Server Side CGI Scripting Forum

    
CGI counter
CGI counter
sunnny

5+ Year Member



 
Msg#: 4397 posted 8:44 pm on Mar 9, 2006 (gmt 0)

Hi,

I am trying to create a hidden counter. What would be the best way to create this. I know there are lots of scripts that I can use, but they are not easy to modify. I thought cgi would be the way to go but I am not sure. I want to maintain the number of hits for each page and then view them from a text file. So something like "URL of file : number of hits" should be stored in the file. Also when I include a cgi file to a .shtml page I get a 404 error, I don't know why?. I don't know how to get started or what would be the best way to create this. Thanks!

Sunny

 

perl_diver

5+ Year Member



 
Msg#: 4397 posted 9:47 pm on Mar 9, 2006 (gmt 0)

post the SSI tag you have been trying to use.

sunnny

5+ Year Member



 
Msg#: 4397 posted 2:12 pm on Mar 10, 2006 (gmt 0)

Hi I am using this:

<!--#include virtual="http://10.42.13.212/cgi-bin/counter.cgi"-->

coopster

WebmasterWorld Administrator coopster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4397 posted 4:02 pm on Mar 10, 2006 (gmt 0)

The URL cannot contain a scheme or hostname, only a path and an optional query string.

mod_include [httpd.apache.org]

sunnny

5+ Year Member



 
Msg#: 4397 posted 3:01 pm on Mar 13, 2006 (gmt 0)

Thanks. Okay this is what I want to do. Our server doesn't offer support for dynamic pages so in short we cannot develop scripts on that server. We want to create a hidden counter for a .shtml page on that server and since that server doesn't support dynamic page we though we can put the script on a different server that supports scripts and then include it in the .shtml file. So...I just found out that this cannot be done. Is there anyway that I can create a hidden counter for a .shtml page on a server that doesnot support scripting of any kind. Note: I can still develop and host the scrit on a seperate server but I need a way for it to communicate to the .shtml page. Any ideas thoughts?

Thanks,
Sunny

coopster

WebmasterWorld Administrator coopster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4397 posted 3:16 pm on Mar 13, 2006 (gmt 0)

My first thought is that you are interesting in server side scripting and the powerful options you have, and that is great. However, you are hosting your site(s) with a provider that doesn't allow it, that's not great -- perhaps a new partner is something to consider? ;)

Alternatives? Well, you could always use a hidden image in your page to hit the other server with some type of query string that you could use to provide tracking.

sunnny

5+ Year Member



 
Msg#: 4397 posted 3:52 pm on Mar 13, 2006 (gmt 0)

Well..I guess we cannot change providers since this is a corporate intranet and the organization doesn't want us to change providers because they don't understand the power of server side scripting. Anyhow, I was looking for alternatives, could you please explain on the method that you suggested(I think it is a good idea!).

Thanks again,
Sunny

coopster

WebmasterWorld Administrator coopster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4397 posted 10:04 pm on Mar 13, 2006 (gmt 0)

It's a very common approach used by site stat providers and site hit counters.

You have an image file in the page which is a reference link. It is basically a 1x1 pixel image of ... well nothing. The url leads to a script that logs the info and sends back the image, ... that never gets seen.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Perl Server Side CGI Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved