Image won't view with post
Posted: Sun Nov 01, 2009 7:31 am
I've made an image with PHP that will work if you put text in:
(as shown on http://testphp.comlu.com/123.php), but if I do:
,
it won't work and just shows blank (an example is on http://testphp.comlu.com/testform.php).
Please help!
Thanks,
Arthur
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