Microsoft
Software
Hardware
Network
Question : cgi equivalent to the php code
Hello Experts,
I have a small php script which actually increment a counter on every hit on the page, becuase it is a php script I cannot include in a .cgi page(perl).
Please can someone help in making a .cgi script equivalent to the below php
$count_my_page = ("hitcounter.txt");
$hits = file($count_my_page);
$hits[0] ++;
$fp = fopen($count_my_page , "w");
fputs($fp , "$hits[0]");
fclose($fp);
echo $hits[0];
?>
your help is much appreciated.
thanks
sam
Answer : cgi equivalent to the php code
#!/usr/bin/perl
@ARGV="hitcounter.txt";
$^I=".bak";
while( <> ){
$hits = ++$_;
print;
}
print "Content-Type: text/plain
$hits
";
Random Solutions
entourage setup with exchange
"Property Sheet" display
MCDBA Vs MCITP which is better?
DDE in Oracle forms
What are the disadvantages to circular logging on an Exchange 2003 Server?
Forbid users from opening a folder on a website
Excel: Macro to load tabs based on cell data
equivalent function in sql for crystal function startswith
Inter process communication in linux.
website animated people