Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/09/2006, 05:04
jonimeloni
 
Fecha de Ingreso: junio-2004
Mensajes: 18
Antigüedad: 22 años, 4 meses
Puntos: 0
No genera imagen

Me gustaría que me dijerais que fallo tiene este código, ya que en localhost me funcionaba y ahora que lo he subido no, es para crear una imagen en la que introduces el numero mediante imagen.php?numero=...

Código PHP:
header("Content-type: image/gif");
$im = ImageCreate(100, 50);
$red = ImageColorAllocate($im, 255, 0, 0);
$white = ImageColorAllocate($im, 255, 255, 255);
$blue = ImageColorAllocate($im, 0, 0, 255);
$black = ImageColorAllocate($im, 0, 0, 0);
$gris = ImageColorAllocate($im, 125, 125, 125);
ImageFill($im, 0, 0, $gris);
// Escribimos el string en (210,30) en negro
//El 5 viene a ser el tamaño de la letra 1-5
$fuente = "/font/MiniForma.ttf";
$numero=$HTTP_GET_VARS["numero"];
ImageTTFText($im, 40,0, 5,40,$blue,$fuente, $numero);
// para calcular el grosor de la fuente
$font_width = ImageFontWidth($fuente);
// y calculamos la lingitud del strig
$string_width = $font_width * (strlen($numero));
// y añadimos la linia de subrallado en (210,50) en negro
while($a<10){
ImageLine($im, 0, $num, (210+$string_width), $num, $black);
$a++;
$num=$num+5;
}
while(
$as<30){
ImageLine($im, $numa, 0, $numa,(210+$string_width), $black);
$as++;
$numa=$numa+5;
}

imagegif($im);
imagedestroy($im);