I had no problem with this code on my school's server, but when I moved it to mine it didn't work at all. Before it would make an image and display the text where I wanted it to, but now if Firefox all it does it display the full URL of the php file and IE displays a lil blank image box. I'm not sure what version the old server had, but mine has php 5.2.1. I copied over the whole folder, it's not like I'm missing a file there, but I'm wondering if it's just my PHP configuration, other PHP functions work fine.
Code:
<?php
header("Content-type: image/png");
$string = $_GET['text'];
$im = imagecreatefrompng("MouseOver.png");
$black = imagecolorallocate($im, 0, 0, 0);
$white = imagecolorallocate($im, 255, 255, 255);
$px = (imagesx($im) - 10 * strlen($string)) / 2;
$font = imageloadfont("Occidental.gdf");
imagestring($im, $font, $px+1, 1+1, $string, $white);
imagestring($im, $font, $px, 1, $string, $black);
imagepng($im);
imagedestroy($im);
?>
Comment