El script es el siguiente:
Código PHP:
<html>
<head>
<link rel=stylesheet type="text/css" href="estilos/Estilo.css">
</head>
<body>
<?php
$promletra=$HTTP_POST_VARS['promletra'];
$libro=$HTTP_POST_VARS['libro'];
$foja=$HTTP_POST_VARS['foja'];
$cotejo=$HTTP_POST_VARS['cotejo'];
$dia_mos=$HTTP_POST_VARS['dia_mos'];
$mes_ano=$HTTP_POST_VARS['mes_ano'];
$fecha_exp = $HTTP_POST_VARS['fecha_exp'];
$link = mysql_pconnect('localhost','root','');
mysql_select_db('certificados');
$query = "SELECT * FROM preescolar WHERE curp LIKE '".$id."%'";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
$paterno = $row["paterno"];
$materno = $row["materno"];
$nombre = $row["nombre"];
$nomb_compl = $nombre." ".$paterno." ".$materno;
$cct = $row["cct"];
$folio = $row["folio"];
$curp = $row["curp"];
$promedio = $row["promedio"];
// En la cabecera HTTP indicamos que lo que devolvemos es una imagen
// de tipo PNG. Para ello utilizamos el tipo MIME: image/png
//Header("Content-type: image/png");
// Creamos la imagen a partir de un fichero existente
$im = imagecreatefromPng("imagenes/Dibujo9.png");
// Escribimos el string en (210,30) en negro
//$font = imageloadfont("bmreceipt.gdf");
ImageString($im, 4, 180, 60, "SECRETARIA DE EDUCACION PUBLICA DE HIDALGO", 10);
ImageString($im, 4, 177, 95, "EL DEPARTAMENTO DE REGISTRO Y CERTIFICACION", 10);
ImageString($im, 4, 290, 132, $cct, 10);
ImageString($im, 4, 215, 175, $nomb_compl, 10);
ImageString($im, 4, 390, 197, $curp, 10);
ImageString($im, 4, 235, 268, $promedio, 10);
ImageString($im, 4, 300, 268, $promletra, 10);
ImageString($im, 4, 87, 325, $dia_mos, 10);
ImageString($im, 4, 270, 325, $mes_ano, 10);
ImageString($im, 4, 105, 375, $folio, 10);
ImageString($im, 4, 370, 390, "RAUL VITE MELO", 10);
ImageString($im, 4, 340, 405, "EL JEFE DEL DEPARTAMENTO", 10);
if(file_exists($im)==true)
{
unlink($im);
// Mostramos la imagen
ImagePng($im,"imagenes/imcerti.png");
}
else
{
// Mostramos la imagen
ImagePng($im,"imagenes/imcerti.png");
}
// Liberamos la memoria que ocupaba la imagen
ImageDestroy($im);
?>
<h1 class="aviso" align="center" >PARTE FRONTAL DEL CERTIFICADO</h1>
<table width="53%" align="center">
<tr>
<td width="100%"><div align="center"><img src="imagenes/imcerti.png" width="73%" height="529" /></div></td>
</tr>
</table>
<p> </p>
<form name="form1" method="post" action="certi2_preescolar.php?id="<? echo $id ?> >
<div align="center">
<p>
<input type="hidden" name="id" value="<? echo $id ?>">
<input type="hidden" name="fecha_exp" value=" <? echo $fecha_exp ?>">
<input type="hidden" name="cotejo" value=" <? echo $cotejo ?>">
<INPUT TYPE=SUBMIT VALUE="SIGUIENTE">
<p> </p>
</div>
</form>
</td>
</body>
</html>