I wrote a small script to generate an image file containing a version number
for use in some web apps we are coding at work.  The problem is, that with
an up-to-date version of IE, the image shows up and can only be saved as a
BMP.  Older versions don't display it, but prompt for download and save it
correctly.  No problems in Mozilla (or presumably in Netscape 4.7x either).

Here's the script:

- - - - -
if(!(empty($version) && empty($product)))
header("Pragma: no-cache");
header("Cache-Control: no-cache, must-revalidate, max_age=0");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Expires: 0");
Header ("Content-type: image/png");

// version.php
// creates new version image for TRS or i3100
// Parameters: $version (the name of the search)
//                         $product (the name of the product)

// get all sizing information
$nAngle = 90;
$nFontSize = 11;
$sFontFile = "C:\WINNT\Fonts\arialbd.ttf";
$nVersionWidth = 15;
$nVersionHeight = 57;

// create the version image
$imgVersion = ImageCreate($nVersionWidth, $nVersionHeight);
        case "TRS":
                $cBackground = ImageColorAllocate($imgVersion, 0, 55, 104);
                $cText = ImageColorAllocate($imgVersion, 255, 255, 255);
        case "i3100":
                $cBackground = ImageColorAllocate($imgVersion, 51, 101,
                $cText = ImageColorAllocate($imgVersion, 255, 255, 255);
ImageFilledRectangle($imgVersion, 0, 0, $nVersionWidth, $nVersionHeight,
ImageTTFText($imgVersion, $nFontSize, $nAngle, 12, 53, $cText, $sFontFile,
if($bold = 1)
        ImageTTFText($imgVersion, $nFontSize, $nAngle, 12, 52, $cText,
$sFontFile, $version);

// send the version image to the browser

// free the version image from memory
$version = "1.0.0";
                <title>TRS/i3100 Version Image Generator</title>
                <meta http-equiv="expires" content="0"/>
                <b>Web App Version Image Generator</b><br/>
                <form method="get" action="version.php">
                        <table border="0px" cellpadding="4px">
                                        <td valign="top">
                                                <input type="radio"
name="product" value="TRS" checked="true"/>&nbsp;TRS<br/>
                                                <input type="radio"
name="product" value="i3100"/>&nbsp;i3100<br/>
                                        <td valign="top">
                                                Font Style:<br/>
                                                <input type="checkbox"
name="bold" value="1" checked="true"/>&nbsp;Bold<br/>
                                        <td valign="middle" colspan="2">
type="text" name="version" value="<?php echo("$version") ?>"
                                        <td valign="middle" align="right"
                                                <input type="submit"
- - - - -

What do I need to do so it will save properly in ALL versions of IE?

PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to