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
Solved

CGI-Counter

Posted on 1998-09-28
3
226 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
  • 2
3 Comments
 
LVL 3

Accepted Solution

by:
zhongbing earned 50 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

Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ICACL switch help. How to include current folder 2 51
Bartender label printing - switch on and off graphics 3 54
OS Selection Menu 1 47
Perl script to process a .csv file 18 44
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

856 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