note 79660 added to function.imagecreate

From: Date: Fri, 07 Dec 2007 01:51:12 +0000
Subject: note 79660 added to function.imagecreate
Groups: php.notes 
Request: Send a blank email to php-notes+get-132914@lists.php.net to get a copy of this message
There was a comment where some one left code for using the image generator with a URL var. (example: domain.com/image.php?t=YourTextHere) He used $t as the variable, but unless previously defined, PHP wont recognize that. You have to use $_REQUEST['t'] as the variable so it will input the string you entered in the URL. <html> <head></head> <body> <?php $im = @imagecreate(128, 16) or die("Cannot Initialize new GD image stream"); $bc = imagecolorallocate($im, 238, 238, 238); $tc = imagecolorallocate($im, 0, 0, 0); imagestring($im, 1, 5, 5, $_REQUEST['t'], $tc); imagepng($im,"im.png"); imagedestroy($im); ?> <img src="im.png" border="0"> </body> </html> Try it now ;) ---- Server IP: 209.41.74.194 Probable Submitter: 68.112.253.239 ---- Manual Page -- http://www.php.net/manual/en/function.imagecreate.php Edit -- https://master.php.net/note/edit/79660 Del: integrated -- https://master.php.net/note/delete/79660/integrated Del: useless -- https://master.php.net/note/delete/79660/useless Del: bad code -- https://master.php.net/note/delete/79660/bad+code Del: spam -- https://master.php.net/note/delete/79660/spam Del: non-english -- https://master.php.net/note/delete/79660/non-english Del: in docs -- https://master.php.net/note/delete/79660/in+docs Del: other reasons-- https://master.php.net/note/delete/79660 Reject -- https://master.php.net/note/reject/79660 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#132914) next »