hmaster
Senior Member
Posts: 716 Reputation: 24
33 / /
Joined: Nov 2004
|
RE: [PHP] Dynamic image help
quote: Originally posted by -dt-
why do you need fopen wrappers enabled to read from a localfile? .... fopen wrappers are what let you access urls like files. they dont disable local file reading.
woops my bad!
quote: Originally posted by Luigi
Thanks to all for the help, I've done something good, but now I'm blocked here.
blah.org/gne.php?number=1.txt
my php read the first line of the file 1.txt (that is the name of an image) and it SHOULD load that image and put it on the file, here's the code I used:
code: $file = file($_GET[number]);
$ua = imagecreatefrompng($file[0]);
$uswidth = imagesx($ua);
$usheight = imagesy($ua);
imagecopy($im, $ua, 5, 2, 0, 0, $uswidth, $usheight);
(im is already defined)
but it doesn't return any image.
Is this because when it reads the first line, it gets image.png(return)?
And another problem I have, is that it doesn't show any text using the imagettftext, could it be because I'm loading 2 images ($im, and then $ua)?
code: $font = "/wp-content/visitor.ttf";
$white = imagecolorallocate($im, 255, 255, 255);
imagettftext($im, 10, 0, 55, 5, $white, $font, 'blah blah blah');
Thanks
Try with the apostrophes $_GET['number']
|
|