Показване в картинка

niki_noki

Registered
PHP:
<?php header ("Content-type: image/png"); 
 $handle = ImageCreate (30, 30) or die ("Cannot Create image"); 
 $color = ImageColorAllocate ($handle, 125, 0, 0); 
 imagestring($handle, "2", $color); 
 ImagePng ($handle); 
 ?>

Къде е проблема :) И защо не изкарва текста "2"
 
Код:
header ("Content-type: image/png"); 
 $handle = ImageCreate (30, 30) or die ("Cannot Create image"); 
 $background_color = ImageColorAllocate ($handle, 125, 0, 0); 
 $text_color = imagecolorallocate($handle, 255, 255, 255);
 imagestring($handle, 5, 5, 5, "2", $text_color); 
 ImagePng ($handle);
Липсват цвят на фон, размер на шрифта и координати.
 
Код:
$query = mysql_query('SELECT * FROM `table WHERE username='admin''); #примерна заявка
$row = mysql_fetch_array($query);
$id = $row['id'];
header ("Content-type: image/png"); 
 $handle = ImageCreate (30, 30) or die ("Cannot Create image"); 
 $background_color = ImageColorAllocate ($handle, 125, 0, 0); 
 $text_color = imagecolorallocate($handle, 255, 255, 255);
 imagestring($handle, 5, 5, 5, $id, $text_color); 
 ImagePng ($handle);
Май трябва да се получи нещо такова.
 
Fakeheal каза:
Код:
$query = mysql_query('SELECT * FROM `table WHERE username='admin''); #примерна заявка
$row = mysql_fetch_array($query);
$id = $row['id'];
header ("Content-type: image/png"); 
 $handle = ImageCreate (30, 30) or die ("Cannot Create image"); 
 $background_color = ImageColorAllocate ($handle, 125, 0, 0); 
 $text_color = imagecolorallocate($handle, 255, 255, 255);
 imagestring($handle, 5, 5, 5, $id, $text_color); 
 ImagePng ($handle);
Май трябва да се получи нещо такова.

Не се получи, но вече и не ми трябва да е от базата данни :)

Авон +1, п
 

Back
Горе