PHP Version 5.1.6 versus PHP Version 4.3.10



The following code works ok in php 5.1.6 but doesnt return an image in 4.3.10.
put this code in the form where the image is being placed.
<img src="random.php?str=<?php echo $str; ?>" alt="capture image" width="60" height="20" vspace="1" align="top" />

This is the random.php code

<?php
$str = $_GET['str'];

$imgX = 60;
$imgY = 20;
$image = imagecreatetruecolor(60, 20);

$backgr_col = imagecolorallocate($image, 238,239,239);
$border_col = imagecolorallocate($image, 208,208,208);
$text_col = imagecolorallocate($image, 46,60,31);

imagefilledrectangle($image, 0, 0, 60, 20, $backgr_col);
imagerectangle($image, 0, 0, 59, 19, $border_col);

$font = "VeraSe.ttf";
$font_size = 11;
$angle = 5;
$box = imagettfbbox($font_size, $angle, $font, $str);
$x = (int)($imgX - $box[4]) / 2;
$y = (int)($imgY - $box[5]) / 2;
imagettftext($image, $font_size, $angle, $x, $y, $text_col, $font, $str);

header("Content-type: image/png");
imagepng($image);
imagedestroy ($image);

?>
Is there something I have to do to so that the imaged is returned when using 4.3.10. The isp who is hosting the website is using this version so I have to adapt to suit.
Please can someone help I have spent hours trying to work round this.
Thanks
bill
.



Relevant Pages

  • Re: another imagejpeg question
    ... http://www.gzentools.com -- free online php tools ... >> I understand that copyresized is not a resample, ... > It's the output quality. ... > imagedestroy; ...
    (comp.lang.php)
  • Load multiple pictures into MySQL?
    ... I'm trying to create a picture database for a site that I'm working on and I ... Have a php script load an entire directory of photos into my ... allow for viewing individual pictures by clicking on the thumbnails. ... imagedestroy; ...
    (comp.lang.php)
  • Re: PHP Version 5.1.6 versus PHP Version 4.3.10
    ... bill wrote: ... imagedestroy; ... Please can someone help I have spent hours trying to work round this. ...
    (alt.php)
  • Re: Load multiple pictures into MySQL?
    ... Not sure on how to do that as I am new to PHP. ... Display thumbnails on a general viewing page. ... allow for viewing individual pictures by clicking on the thumbnails. ... imagedestroy; ...
    (comp.lang.php)
  • Re: How can I use a member function without create an instance of that class in PHP?
    ... bill wrote: ... I have been coding PHP for the better part of 15 years, but am just now learning the ins & outs of OOP. ... This is why static methods cannot access non-static class members. ...
    (comp.lang.php)