How can i edit .htaccess file to make client run php script, but in png/jpg extension. Soo... User will visit url
http://example.com/script.png and he will see "test"(php script will return this value), not image. That's what i already did: .htaccess file:
AddType application/x-httpd-php .png
script.png file:
<?php
header("Content-type: image/png");
echo 'test';
?>
What is wrong with this code? Why it doesn't work? Browser tries to download the image :/
Add the following line to your .htaccess file
AddHandler application/x-httpd-php .png
This tells the server to process all files ending with .png as .php.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With