oraribyrag1 Posted April 4, 2010 Share Posted April 4, 2010 I'd like to be able to make an image, that when viewed, that will execute a PHP script. How do I get started? Quote Link to comment https://forums.phpfreaks.com/topic/197540-use-an-image-to-execute-a-php-script/ Share on other sites More sharing options...
Alex Posted April 4, 2010 Share Posted April 4, 2010 <?php readfile('path/to/file.png'); header('Content-type: image/png'); That PHP script outputs an image, you can add whatever you want to it. If you need an image extension you can change the file to *.png (or any other image extension) and use .htaccess to have PHP interpret that file. Quote Link to comment https://forums.phpfreaks.com/topic/197540-use-an-image-to-execute-a-php-script/#findComment-1036754 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.