Need to redirect mime types to run a php script and then display a picture
Just upgraded my web hosting to PHP5 and discovered some very random issues
My .htaccess file is:
"
AddHandler imagesstuff .jpg
Action imagesstuff "/run_script.php"
"
My file run_scipt.php is (was previously using PATH_TRANSLATED but converted to usr this as PHP5 no longer supports PATH_TRANSLATED:
"
$file = $SERVER["REQUEST_URI"];
$file = str_replace($SERVER['SCRIPT_NAME'],"",$file);
echo $file;
die();
"
but the issue is that when you browse a *.jpg file is it randomly shows the picture straight away or it shows parse and string errors (all errors are different for each jpg file and are on lines like 251, 178 etc..). Its almost like apache is ignoring my .htaccess file and is trying run the jpg as php files.
When direcly url'ing to the pictures it doesnt echo anything on the screen at all just shows error or the picture.
Pleae can someone help me as I have spent hours trying to figure this one out and my hosting company are telling me its my PHP code.