need help with this little perl script

D

Danny

this originally used the FLY executable to generate a graphical counter
which used to be ok but my server disabled the executiuon of binaries, so
now I just want the script to do what it does (update the counter.txt) and
not do any FLY stuff. I just need something returned to the calling .html,
I guess a blank graphic would do. But how do you do the below, so the html
will call the counter script and have something returned.
This part of the script doesnt work

# $output = `$flyprog -i $fly_temp`;
#$output = `blank.gif`';
print "Content-type: image/gif\n\n";
print "<img src=\"images\/blank.jpg\">";

original code was:
$output = `$flyprog -i $fly_temp`;
print "Content-type: image/gif\n\n";
print "$output";
 
G

gnari

Danny said:
this originally used the FLY executable to generate a graphical counter
which used to be ok but my server disabled the executiuon of binaries, so
now I just want the script to do what it does (update the counter.txt) and
not do any FLY stuff. I just need something returned to the calling ..html,
I guess a blank graphic would do. But how do you do the below, so the html
will call the counter script and have something returned.
This part of the script doesnt work

# $output = `$flyprog -i $fly_temp`;
#$output = `blank.gif`';
print "Content-type: image/gif\n\n";
print "<img src=\"images\/blank.jpg\">";

this is not a HTML newsgroup but i can tell you that images do not contain
HTML tags
original code was:
$output = `$flyprog -i $fly_temp`;

just replace this line with some code that reads the blank
graphic into $output. if any graphics libraries like Image::Magick
are installed, you could generate your own image here.
 
G

Gunnar Hjalmarsson

Danny said:
this originally used the FLY executable to generate a graphical
counter which used to be ok but my server disabled the executiuon
of binaries, so now I just want the script to do what it does
(update the counter.txt) and not do any FLY stuff. I just need
something returned to the calling .html, I guess a blank graphic
would do. But how do you do the below, so the html will call the
counter script and have something returned. This part of the script
doesnt work

# $output = `$flyprog -i $fly_temp`;
#$output = `blank.gif`';
print "Content-type: image/gif\n\n";
print "<img src=\"images\/blank.jpg\">";

original code was:
$output = `$flyprog -i $fly_temp`;
print "Content-type: image/gif\n\n";
print "$output";

If what you want is running the script without displaying anything,
you don't need to bother with a blank image, but you can just do:

print "Status: 204 No Content\n\n";

Or if you want to convert the script to a text based counter, you can do:

print "Content-type: text/html\n\n";
print $count;

(or whatever the name of the variable is that contains the hits).

HTH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top