All4172 Posted September 16, 2006 Share Posted September 16, 2006 I use the same exact script on a few different servers, but on the my new server I just put it on, in the title bar at top of browser it'll say "name.php (PNG Image 30x10 pixels)".Only problem is I don't have any PNG images in the script at all. On this server its in PHP Safe Mode, would that make a difference? Quote Link to comment https://forums.phpfreaks.com/topic/20975-server-interprets-php-file-as-png-pic-file/ Share on other sites More sharing options...
shocker-z Posted September 16, 2006 Share Posted September 16, 2006 very weird.. does it display properly except from title bar? have u tryed creating aphp file and just having <?php php_info(); ?> if that works then how bout posting your code?RegardsLiam Quote Link to comment https://forums.phpfreaks.com/topic/20975-server-interprets-php-file-as-png-pic-file/#findComment-93038 Share on other sites More sharing options...
All4172 Posted September 16, 2006 Author Share Posted September 16, 2006 Hmm looks like this server didn't like one of my headers, so I modified it and it worked :) Quote Link to comment https://forums.phpfreaks.com/topic/20975-server-interprets-php-file-as-png-pic-file/#findComment-93044 Share on other sites More sharing options...
shocker-z Posted September 16, 2006 Share Posted September 16, 2006 I'm not seeing the problem.. your creating an image.. and it say's PNG in title bar.. it's a png so whats wrong?sorry probs just me having long slow day at work..EDIT: must have clicked to reply before he had edited out his code :) Quote Link to comment https://forums.phpfreaks.com/topic/20975-server-interprets-php-file-as-png-pic-file/#findComment-93048 Share on other sites More sharing options...
Daniel0 Posted September 16, 2006 Share Posted September 16, 2006 [quote author=shocker-z link=topic=108295.msg435554#msg435554 date=1158421034]I'm not seeing the problem.. your creating an image.. and it say's PNG in title bar.. it's a png so whats wrong?sorry probs just me having long slow day at work..[/quote]He sent a wrong header. Quote Link to comment https://forums.phpfreaks.com/topic/20975-server-interprets-php-file-as-png-pic-file/#findComment-93049 Share on other sites More sharing options...
All4172 Posted September 16, 2006 Author Share Posted September 16, 2006 Looks like I spoke too soon. At the bottom portion I have the headers like this:[code]switch ($a) { default: header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header ("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header ("Pragma: no-cache"); // HTTP/1.0 header ("Content-type: image/png"); $im = @ImageCreate (30, 10) or die ("Cannot Initialize new GD image stream"); $white = ImageColorAllocate ($im, 255, 255, 255); $trans = imagecolortransparent($im,$white); ImagePng ($im); incrementVisits ($HTTP_REFERER,$REMOTE_ADDR); break; case "vs": print viewStatus($PHP_SELF,$password); break; case "rc": print resetCounter($pageID,$PHP_SELF,$password); break; case "dc": print deleteCounter($pageID,$PHP_SELF,$password); break; } [/code]It displays correctly on all other servers, but this one it seems to have trouble with either the imagecreate or the png header. Any advice? Quote Link to comment https://forums.phpfreaks.com/topic/20975-server-interprets-php-file-as-png-pic-file/#findComment-93069 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.