Gossamer Forum
Home : General : Perl Programming :

displaying images

Quote Reply
displaying images
I'm trying to make a hit counter using fly but it just won't display in the browers.

this is the code I'm using.
print "Content-type: [contest] image/gif\n\n";
print `fly -q -i fly_temp.txt`;

It shows a broken image when called from an img tag, but if I print the fly output to a file and then view that file, it works great.

At first I was thinking its my browser because I went to some counter sites that used the same basic code as me and their links were broken, but it does it in netscape too.

I was just wondering if there is some weird trick, or something you guys have seen before.

The link to the code is http://www.mach.org/fly-1.6.5/gdtest.cgi can you see if it works for you?

thanks for your time.

Quote Reply
Re: displaying images In reply to
Hi,

Try printing text/html headers and print the output. You may be getting a system error as fly is not in the path.

Cheers,

Alex

--
Gossamer Threads Inc.
Quote Reply
Re: displaying images In reply to
That didn't work :(

does anyone know where I can find a list of all available headers, then I could try all the image ones and see if any work.

I've come to the conclusion that its the headers because it prints out he right stuff, just the browers doesn't know its an image.

Quote Reply
Re: displaying images In reply to
I did something similar, and instead of using "print" I used "return" and it seemed to work. I just called the script with a normal <IMG SRC="/url/to/myscript.cgi">. Give that a go, can't promise it'll work with yours :)

Cheers,
R