Gracias por su pronta respuestas y animos de ayudar de verdad agradecido, esta es mi bd
Código SQL:
Ver originalCREATE TABLE IF NOT EXISTS `datos` (
`cedula` VARCHAR(15) NOT NULL,
`nombre` VARCHAR(20) NOT NULL,
`apellido` VARCHAR(20) NOT NULL,
`direccion` VARCHAR(20) NOT NULL,
PRIMARY KEY (`cedula`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
y este es el formulario de busqueda.
Código PHP:
Ver original<?php
if (isset ($_SESSION['username'])){ echo "";
} else{
echo"<script language='JavaScript' type='text/JavaScript'> location.href='../html/inicia_session.html'</script>";}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin tÃ*tulo</title>
<link href="../../css/maqueta.css" rel="stylesheet" type="text/css" />
<script src="../../js/validad_datos.js"></script>
</head>
<body onload="MM_preloadImages('../imagenes/arrow_1.png')">
<br />
<form id="registra" name="registra" method="post" action="result_buscar.php" onSubmit="return validarForm(this);">
<table width="680" height="0%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="135" colspan="3" class="horacentro"><img src="http://www.forosdelweb.com/imagenes/url.gif" width="700" height="198" />
<script languaje="JavaScript">
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")
document.write("<small><font color='black' face='verdana,geneva,sans-serif'>"+dayarray[day]+" "+daym+" de "+montharray[month]+" de "+year+"</font></small>")
</script>
<div id="topnav">
<ul>
<li class="last",class="last"><a href="http://www.forosdelweb.com/f18/opciones_del_sistema.php">Inicio</a></li>
</ul>
</div></tr>
<tr>
<td height="18" background="../../imagenes/fondo.png">
<div align="center">»
<span class="titulo">Estudiando</span> «</span></div></td>
</tr><tr>
<td><div class="rprintf">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="atras"><a href="registrar facturas.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Atras','','../../imagenes/arrow_1.png',1)"><img src="http://www.forosdelweb.com/imagenes/arrow.png" name="Atras" width="28" height="28" border="0" id="Atras" title="Atras"/></a></td></tr>
<tr>
<td height="125" align="center"><table width="65%" border="0" >
<tr>
<td height="25">Ingrese cedula a buscar:</td>
<td height="25"><input type="text" name="cedula" id="cedula" /></td><td height="25"><input type="submit" name="Buscar" value="Buscar"/></td>
</tr>
</table>
<p> </p>
<p align="right"><a href="http://www.forosdelweb.com/index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Salir','','../../imagenes/salir1.png',1)"><img src="http://www.forosdelweb.com/imagenes/salir.png" name="Salir" width="90" height="28" border="0" id="Salir" title="Salir"/></a></p></td></tr></table></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="18" background="../../imagenes/fondo.png" class="footer"></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
</table>
</form>
</body>
</html>
y este el resultado de la busqueda en el cual quiero colocar un link que al abrir me muestre una planilla con los datos listos para imprimir, ejemplo el estudiante con nombre ________- cedula____- estudia en esta casa de estudios.
firma: fulano
Código PHP:
Ver original<?php
if (isset ($_SESSION['username'])){ echo "";
} else{
echo"<script language='JavaScript' type='text/JavaScript'> location.href='../html/inicia_session.html'</script>";}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin tÃ*tulo</title>
<link href="../../css/maqueta.css" rel="stylesheet" type="text/css" />
<script src="../../js/validad_datos.js"></script>
</head>
<body onload="MM_preloadImages('../../imagenes/arrow_1.png','../../imagenes/salir1.png')">
<br />
<form id="registra" name="registra" method="post" action="" onSubmit="return validarForm(this);">
<table width="680" height="0%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="135" colspan="3" class="horacentro"><img src="http://www.forosdelweb.com/imagenes/url.gif" width="700" height="198" />
<script languaje="JavaScript">
var mydate=new Date()
var year=mydate.getYear()
if (year < 1000)
year+=1900
var day=mydate.getDay()
var month=mydate.getMonth()
var daym=mydate.getDate()
if (daym<10)
daym="0"+daym
var dayarray=new Array("Domingo","Lunes","Martes","Miercoles","Jueves","Viernes","Sabado")
var montharray=new Array("Enero","Febrero","Marzo","Abril","Mayo","Junio","Julio","Agosto","Septiembre","Octubre","Noviembre","Diciembre")
document.write("<small><font color='black' face='verdana,geneva,sans-serif'>"+dayarray[day]+" "+daym+" de "+montharray[month]+" de "+year+"</font></small>")
</script>
<div id="topnav">
<ul>
<li class="last",class="last"><a href="http://www.forosdelweb.com/f18/opciones_del_sistema.php">Inicio</a></li>
</ul>
</div></tr>
<tr>
<td height="18" background="../../imagenes/fondo.png">
<div align="center">»
<span class="titulo">Parcial</span> «</span></div></td>
</tr><tr>
<td>
<div class="rprintf">
<table width="100%" border="0" cellspacing="0" cellpadding="0"><tr>
<td class="atras"><a href="buscar_eliminar_registro.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Atras','','../../imagenes/arrow_1.png',1)"><img src="http://www.forosdelweb.com/imagenes/arrow.png" name="Atras" width="28" height="28" border="0" id="Atras" title="Atras"/></a></td></tr>
<tr>
<td height="125" align="center"> <?php
include ("../conexion/conecta.php");
$cedula=$_POST['cedula'];
$con=mysql_connect ($host,$user,$pass) or
die ("problemas con la conexion al server"); $result=mysql_query("SELECT * FROM datos WHERE CEDULA='$_POST[cedula]'", $con);
?>
<table border="0" cellspacing="0" cellpadding="4" align="center">
<tr>
<td></td>
<td><p align="center">estudiando</p></td>
<td></td>
</tr><tr>
<td></td><td>
<table bordercolor="#D2D2D2" cellpadding="1" cellspacing="0" align=center border=1 width="100%">
<tr>
<th colspan=4> datos obtenidos </th>
</tr>
<tr>
<td colspan=2>cedula:</td>
<td colspan=2> <input type="text" value="<?php echo $row["cedula"];?>" class="transforme2" onFocus="this.className='transforme2'" onblur="this.className='transforme3'" /></td>
<tr>
<td colspan=2>nombre:</td>
<td colspan=2><input type="text" value="<?php echo $row["nombre"];?>" class="transforme2" onFocus="this.className='transforme2'" onblur="this.className='transforme3'" /></td>
</tr>
<tr><td colspan="2">apellido: </td>
<td><input type="text" size="20" value="<?php echo $row["apellido"];?>" class="transforme2" onFocus="this.className='transforme2'" onblur="this.className='transforme3'" /></td>
</tr>
<tr>
<td colspan=2>direccion:</td>
<td colspan=2><input type="text" value="<?php echo $row["direccion"];?>" class="transforme2" onFocus="this.className='transforme2'" onblur="this.className='transforme3'" /></td>
</tr>
</tr>
</table>
<table width="11%" height="6" border="0" align="center" bordercolor="#D2D2D2">
<tr><td><?php echo "<a href=./eliminar_registro.php?cedula=".$row["cedula"].">";?> <input type="button" size="10" onclick="return confirm('¿Deseas realmente eliminar la cedula <?php echo $row["cedula"]; ?>?')" value="Eliminar Registro"></a></td></tr>
</table>
<?php
} else {
echo "¡ No se ha encontrado ningún registro !";
}
?><p align="right"><a href="http://www.forosdelweb.com/index.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Salir','','../../imagenes/salir1.png',1)"><img src="http://www.forosdelweb.com/imagenes/salir.png" name="Salir" width="90" height="28" border="0" id="Salir" title="Salir"/></a></p></td></tr></table></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="18" background="../../imagenes/fondo.png" class="footer"></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
<tr>
</table>
</form>
</body>
</html>