Link to home
Start Free TrialLog in
Avatar of alexeijames
alexeijames

asked on

Hotlinking: What do i output from my cgi?

i have a cgi program to stop people from hotlinking an image from my site.

my simple website to be protected is as follows:
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<img src=http://www.mywebserver.com/~user/cgi-bin/myprogram.cgi?../images/figures.png">
</body>
</html>

my cgi accepts  ../images/figures.png as an input parameter.
it checks the HTTP_REFERER is http://www.mywebserver.com

This is not the problem though.

My problem is what i must write as outtput from my cgi.

I think as a first line i must output:
 
Content-type: image/png
i simply want the page to be generated as:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<img src="../images/figures.png">
</body>
</html>

My program is written in pascal so i dont want perl code.... all im asking is what i should output from my cgi... as a said i think the first line of output should be:

Content-type: image/png
Then i dont know what must follow

500 points!!!

thx guys!!
Avatar of alexeijames
alexeijames

ASKER

i dont know if the code is meant to remain the same infact!!
as so:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<img src=http://www.mywebserver.com/~user/cgi-bin/myprogram.cgi?../images/figures.png">
</body>
</html>

all i want is to display my image on screen!!!!!!!!!!!

Please help!!
ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
haha ...i tell you what tin tin...just coz you are the first person to answer me you got yourself 500 points!!!

I figured it out already!

nice one!!