Forum Moderators: phranque
I'd like to ask the CGI elite if it is possible to link URLs from a CGI script. I'm wanting to avoid links to folders being displayed - to prevent unwanted browsing in folders/website rippers. Now, the .htaccess looks great but the site I'm working on doesn't have this enabled nor do they have PHP. They run Apache server. Can anyone advise? I have a PHP script for requesting images but as I say, PHP is not available but CGI is. Images are linked like this in HTML and poll the PHP script to get the image:
<img src = 'getme.php?image=image-12-800.jpg '>.
Basically, I'd like to do this in CGI. I've tried searching the site here but to no avail (as far as I'm aware). Below is a rough sample of the PHP script.
SAMPLE:
$path="../yourdirectory/"; // Path to protected directory
$mimetype="image/jpeg"; // Mime type of file
Header("Content-type: $mimetype");
readfile ( $path . $image );
}
Cheers,
sloth from Scotland