I created a simple counter script that I want to display and execute via an html page. I am able to get the perl script to execute when directly accessed but not from a seperate html page
How do I call the script from an html page and display its output.
Here is the perl code I was using:
#!/usr/bin/perl
use CGI qwstandard);
open(COUNT, "< count.log"
chomp($var=<COUNT>);
close(COUNT) ;
$var=$var+1;
open(COUNT1, "> count.log"
print COUNT1 "$var\n";
close(COUNT1);
print "Content-type: text/html\n\n";
print "You are visitor $var";
Here is the simple html page I was try to use
<HTML>
<HEAD>
<TITLE> Counter </TITLE>
</HEAD>
<BODY>
<H1> COUNTER SCRIPT </H1>
<img src="/cgi-bin/counter.pl">
</BODY>
</HTML>
~
Please set set me straight.
-Danny
How do I call the script from an html page and display its output.
Here is the perl code I was using:
#!/usr/bin/perl
use CGI qwstandard);
open(COUNT, "< count.log"
chomp($var=<COUNT>);
close(COUNT) ;
$var=$var+1;
open(COUNT1, "> count.log"
print COUNT1 "$var\n";
close(COUNT1);
print "Content-type: text/html\n\n";
print "You are visitor $var";
Here is the simple html page I was try to use
<HTML>
<HEAD>
<TITLE> Counter </TITLE>
</HEAD>
<BODY>
<H1> COUNTER SCRIPT </H1>
<img src="/cgi-bin/counter.pl">
</BODY>
</HTML>
~
Please set set me straight.
-Danny