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
In Oracle Designer, I'm getting this error. RME-00207: Too many open activities (10 maximum).
Running Silverlight 3.0 Out of Browser
DBI DBD::ODBC Errors Truncating SQL Server Text Fields
Moving NTLM Authentication to another server
Software solutions for imaging a computer lab
show/hide DIVS in flash with NS7 (DHTML)
Exchange 2000 -1603 (Jet_errNoCurrentRecord, currency not on a record)
Validate UK Mobile Phone Numbers
Your message has been successfully relayed to the following recipients....
Change Timer Job Definition for alerts in sharepoint central administration