Hi,
I'm trying to run a php script in a .jpg which will create a image file but i cant get this to work as i think it should. I basically get the PHP appearing in the browser as text.
I read a few sits that claim that placing the .htaccess file in the directory and entering this line..
ForceType application/x-httpd-php
..should convince apache to run the script and return the result as jpg. The two files sit in their own directory and i think im right that the .htaccess file in the current directory is the one referenced first.
I'm using goDaddy hosing for this one and i can see GD is enabled which i believe is necessary as well.
The script is as follows but i dont think its wrong, it sits in image.jpg.
<?php
header("Content-type: image/jpeg");
$image = imagecreatefromjpeg ("images/background.jpg");
imagejpeg($image);
imagedestroy($image);
?>
Can anyone see what i'm doing wrong? i though i had done enough research into doing this and im totally stumped as to why it does not work.
Thanks in advance,
Cheers