
25/09/2012, 18:12
|
| | Fecha de Ingreso: noviembre-2004 Ubicación: Medellín
Mensajes: 121
Antigüedad: 20 años, 4 meses Puntos: 1 | |
Problema buscando Hola, tratando de buscar me salen los errores:
Notice: Undefined index: texCedula in C:\xampp\htdocs\seleccion_de_personal\mostrar_trab ajador_buscado.php on line 20
Notice: Undefined variable: texCedula in C:\xampp\htdocs\seleccion_de_personal\mostrar_trab ajador_buscado.php on line 21
Mostrar trabajador
Programa 1
<script type="text/javascript">
function validarCedula(e) {
tecla = (document.all)?e.keyCode:e.which;
if (tecla==8 || tecla==0){
return true;
//return !(window.event && window.event.keyCode == 13);
}
patron = /([0-9\.])/;
te = String.fromCharCode(tecla);
return patron.test(te);
}
function buscar(){
document.form1.action="mostrar_trabajador_buscado. php";
document.form1.submit();
}
</script>
</head>
<body>
<p>Buscar trabajador</p>
<form id="form1" name="form1" method="get" action="">
<p>Cedula </p>
<p>
<label>
<input type="text" name="texCedula" id="texCedula" onKeyPress="return validarCedula(event)" value="" />
</label>
</p>
<p>
<label>
<input type="submit" name="butBuscar" id="butBuscar" value="Buscar" onclick="buscar();"/>
</label>
</p>
</form>
<p> </p>
<p> </p>
</body>
Programa 2
<body>
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
$link = mysql_connect('localhost', 'yonerflash', 'f740166');
if (!$link) {
die('No pudo conectarse: ' . mysql_error());
}
$database="admision";
mysql_select_db($database, $link) or die( "Unable to select database");
$cedula=$_POST['texCedula'];
$query = "SELECT nombres FROM candidatos WHERE cedula='$texCedula'";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_NUM)){
echo "Nombre :{$row[0]} <br>";
}
?>
Mostrar trabajador
</body>
Me podrían ayudar? Gracias |