Como executar o script php na extensão png / jpg
Como posso editar o arquivo .htaccess para fazer o cliente executar o script php, mas na extensão png / jpg. Soo ... O usuário visitará o URL
http://example.com/script.png e ele verá "test" (o script php retornará esse valor), não a imagem. Foi o que eu já fiz: .htaccess file:
AddType application/x-httpd-php .png
arquivo script.png:
<?php
header("Content-type: image/png");
echo 'test';
?>
O que está errado neste código? Por que não funciona? O navegador tenta fazer o download da imagem: /