Jacbey Posted January 3, 2012 Share Posted January 3, 2012 Hi Guys, I am trying to disguise my php script as a .gif file for the purposes of a shopping cart. Basically, you click on the .gif which is placed on the page and it takes you to an image unless it has variables attached to it. Google use this for their checkout so I know this is possible. Does anyone have any ideas how I would go about doing this? Thanks in advance, Jacob. Quote Link to comment https://forums.phpfreaks.com/topic/254244-php-script-as-gif-image/ Share on other sites More sharing options...
teynon Posted January 3, 2012 Share Posted January 3, 2012 In your httpd.conf file you need to add gif to the PHP extensions. AddType application/x-httpd-php .gif Quote Link to comment https://forums.phpfreaks.com/topic/254244-php-script-as-gif-image/#findComment-1303550 Share on other sites More sharing options...
Jacbey Posted January 3, 2012 Author Share Posted January 3, 2012 Yeah, I did that but I don't get how you link an image to the php script. Because I'm presuming you rename the script something like script.php to script.gif but then how to you link the image to it? Quote Link to comment https://forums.phpfreaks.com/topic/254244-php-script-as-gif-image/#findComment-1303553 Share on other sites More sharing options...
scootstah Posted January 3, 2012 Share Posted January 3, 2012 I don't see why this would ever be necessary for legitimate purposes. You are either making a very bad design decision or you are trying to do something malicious. Quote Link to comment https://forums.phpfreaks.com/topic/254244-php-script-as-gif-image/#findComment-1303567 Share on other sites More sharing options...
Jacbey Posted January 3, 2012 Author Share Posted January 3, 2012 It's not something malicious. Google use it, look. http://checkout.google.com/buttons/checkout.gif?merchant_id=*************&w=180&h=46&style=white&variant=text&loc=en_US That's a PHP script if it has variables attached to it. But if you just go to http://checkout.google.com/buttons/checkout.gif it's a .gif file. I'm trying to do something like that. Quote Link to comment https://forums.phpfreaks.com/topic/254244-php-script-as-gif-image/#findComment-1303655 Share on other sites More sharing options...
cyberRobot Posted January 3, 2012 Share Posted January 3, 2012 Yeah, I did that but I don't get how you link an image to the php script. Because I'm presuming you rename the script something like script.php to script.gif but then how to you link the image to it? You could utilize the imagecreatefromgif() function: http://php.net/manual/en/function.imagecreatefromgif.php Quote Link to comment https://forums.phpfreaks.com/topic/254244-php-script-as-gif-image/#findComment-1303729 Share on other sites More sharing options...
Jacbey Posted January 3, 2012 Author Share Posted January 3, 2012 Yeah, I did that but I don't get how you link an image to the php script. Because I'm presuming you rename the script something like script.php to script.gif but then how to you link the image to it? You could utilize the imagecreatefromgif() function: http://php.net/manual/en/function.imagecreatefromgif.php Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/254244-php-script-as-gif-image/#findComment-1303731 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.