Ok. I can't access the server until the FTP is up on monday, so I'll just ask if this is going to work:
- I "enhanched" the template.pm
- I added this code to site_html_templates.pl:
if ( open (HITS_RD, "d:/webserver/cosmo-web/site/counter/count.txt") ) {
$hits = <HITS_RD>;
close HITS_RD;
if ( open (HITS_WR, ">d:/webserver/cosmo-web/site/counter/count.txt") ) {
print HITS_WR ++$hits;
close HITS_WR;
}
}
$counter1 = $hits + 68349;
$counter2 = $hits + 120000;
$cosmorand = rand;
}I added &add_counter; below the &html_print_headers; line in all subs that generate the CGI-pages.
Now, can I add things like:to my CGI template files (add.html, etc.)? Or have I misunderstood?
- I "enhanched" the template.pm
- I added this code to site_html_templates.pl:
Code:
sub add_counter { if ( open (HITS_RD, "d:/webserver/cosmo-web/site/counter/count.txt") ) {
$hits = <HITS_RD>;
close HITS_RD;
if ( open (HITS_WR, ">d:/webserver/cosmo-web/site/counter/count.txt") ) {
print HITS_WR ++$hits;
close HITS_WR;
}
}
$counter1 = $hits + 68349;
$counter2 = $hits + 120000;
$cosmorand = rand;
}
Now, can I add things like:
Code:
counter 1 is <%counter1%>, and <%cosmorand%> is a random number