Code: Select all
<?php
header ("Content-type: image/png");
$text = "text";
$im = imagecreate (400, 30);
$black = imagecolorallocate ($im, 0, 0, 0);
$white = imagecolorallocate ($im, 255, 255, 255);
imagettftext ($im, 20, 0, 10, 20, -$white,
"Arial.ttf", $text);
imagepng ($im);
imagedestroy ($im);
?>Code: Select all
<?php
header ("Content-type: image/png");
$text = $_POST("text");
$im = imagecreate (400, 30);
$black = imagecolorallocate ($im, 0, 0, 0);
$white = imagecolorallocate ($im, 255, 255, 255);
imagettftext ($im, 20, 0, 10, 20, -$white,
"Arial.ttf", $text);
imagepng ($im);
imagedestroy ($im);
?>it won't work and just shows blank (an example is on http://testphp.comlu.com/testform.php).
Please help!
Thanks,
Arthur