Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

CGI-Counter

Posted on 1998-09-28
3
Medium Priority
?
232 Views
Last Modified: 2013-12-25
Can anyone help me with an example of a counter, to be placed in the cgi-bin? It has to run on a unix box, i self run NT.
0
Comment
Question by:jbrugman
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
zhongbing earned 200 total points
ID: 1828872
perl example:

#! /usr/bin/perl
$|=1;
print "Content-type:text/html\n\n";

$file = "count.txt";
open(FILE, "$filename")||die "open file $filename error $!\n";
line=<FILE>;
($name, $count)=split(/=/, $line);
$count = $count + 1;
close<FILE>
printf "you are the %d vistor\n" "$count"
$file = "count.txt";
open(FILE, ">$filename")||die "open file $filename error $!\n";
print "$name=$count"
close<FILE>
0
 
LVL 4

Author Comment

by:jbrugman
ID: 1828873
How does it work? Do i need Perl? How do i call it? Please explain, cince i am new to this.
Greetings,
Justus
0
 
LVL 3

Expert Comment

by:zhongbing
ID: 1828874
you are right , it's a perl cgi, to use it , for example you use unix box and netscape webserver. you should:
1. should install perl, and make a cgi dirctory in the web server setting, say "cgi"
2. in your html file, put a href:
   <a href="cgi/perlname.pl" > </a>
3. put the perl file to the cgi directory.


0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question