Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Directory Action

Status
Not open for further replies.

geebers

Technical User
May 29, 2009
20
US
my.php file runs whenever a jpeg file is requested. The directive looks like....

<Directory "/opt/lampp/htdocs/images/">
AddHandler image/jpeg .jpg
Action image/jpeg /opt/lampp/cgi-bin/my.php
</Directory>

again, this works, however, the jpeg image does not display in the browser. I need my.php to run AND the jpeg file that was requested to be displayed in the browser.

thanks for any help.
 
FWIW, a hack that made it work.....

in my.php...

<?php
$result = shell_exec("getImageURL.bash");
?>

<img src="<php echo $result ?>" />


basically, my .bash script decides the next image to display, in this example /images/image1.jpg and THEN copies it to /temp/image1.jpg
the string "/temp/image1.jpg" is then echoed and becomes the value of $result. I'd rather not have to make a copy of the jpg file, but seems to be the only way it works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top