Jump to content

Server interprets php file as png pic file?


All4172

Recommended Posts

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?
Link to comment
Share on other sites

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?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.