Jump to content


Photo

Server interprets php file as png pic file?


  • Please log in to reply
5 replies to this topic

#1 All4172

All4172
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts

Posted 16 September 2006 - 02:32 PM

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?

#2 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 16 September 2006 - 03:19 PM

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?

Regards
Liam
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#3 All4172

All4172
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts

Posted 16 September 2006 - 03:31 PM

Hmm looks like this server didn't like one of my headers, so I modified it and it worked :)

#4 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 16 September 2006 - 03:37 PM

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 :)
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#5 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 16 September 2006 - 03:39 PM

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..


He sent a wrong header.

#6 All4172

All4172
  • Members
  • PipPipPip
  • Advanced Member
  • 78 posts

Posted 16 September 2006 - 04:25 PM

Looks like I spoke too soon.  At the bottom portion I have the headers like this:

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; 
} 

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?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users