problema con validacion de variable
Publicado por zendi (1058 intervenciones) el 24/04/2015 02:48:52
que tal a todos;
tengo un problemilla con este codigo para validar:
EN REALIDAD SI ESTA VALIDANDO CON LAS DOS PREGUNTAS, PERO EN LA PREGUNTA CUANDO ES IGUAL A CERO
DEBIERA PASAR A LA TABLA QUE ESTA EN NEGRITA, LA IDEA ES QUE EL USUARIO DECIDA SI VA A GRABAR UN REGISTRO NUEVO.
SI ALGUIEN ME AYUDA. GRACIAS
tengo un problemilla con este codigo para validar:
EN REALIDAD SI ESTA VALIDANDO CON LAS DOS PREGUNTAS, PERO EN LA PREGUNTA CUANDO ES IGUAL A CERO
DEBIERA PASAR A LA TABLA QUE ESTA EN NEGRITA, LA IDEA ES QUE EL USUARIO DECIDA SI VA A GRABAR UN REGISTRO NUEVO.
SI ALGUIEN ME AYUDA. GRACIAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
$query="SELECT cedula FROM public.pacientes WHERE cedula='$cedula'";
$res=@pg_query($connect,$query);
if(@pg_num_rows($res)>0)
{
echo "<script type='text/javascript'>
alert('Su Nro de CEDULA ya está REGISTRADA ');
window.location='pacientes2.php';
</script>";
}
elseif(@pg_num_rows($res)==0)
{
echo "<script type='text/javascript'>
alert('Su Nro de CEDULA No está REGISTRADA');
window.location='pacientes2.php';
</script>";
}
?>
<table>
<tr>
<input type="hidden" name="cedula" value="<?php echo $cedula; ?>"/>
<td class="sr" align='right' style="text-decoration:none">Nombres del Niño/a:</td>
<td class="sr"><input type="text" name="nombres" size="50" maxlength="50" align="right" class="color1" onClick="nombrenin(this);"/></td>
</tr>
<tr>
<td class="sr" align='right' style="text-decoration:none">Apellidos del Niño/a:</td>
<td class="sr"><input type="text" name="apellidos" size="50" maxlength="50" align="right" class="color1"/></td>
</tr>
<tr>
<td class="sr" align='right' style="text-decoration:none">Direccion:</td>
<td class="sr"><input type="text" name="direccion" size="120" maxlength="120" align="right" class="color1"/>
</td>
</tr>
<tr>
<td class="sr" align='right' style="text-decoration:none">Cuenta de Correos:</td>
<td class="sr"><input type="text" name="correo" size="50" maxlength="50" align="right" class="color1"/>
</td>
</tr>
<tr>
<td class="sr" align='right' style="text-decoration:none">Telefonos:</td>
<td class="sr"><input type="text" name="telefono" size="10" maxlength="10" align="right" class="color1"/>
<strong> Años Meses Días </strong>
</td>
</tr>
<TR>
<td class="sr" align='right' style="text-decoration:none">Fecha de Nac. del Niño/a:</td>
<td><input type="text" size=10 maxlength=10 name="fecha_nac" onBlur="calcular_edad();" id="fecha_nac" onKeyUp="mascara(this,'/',patron,true)" class="color1">
<input type="text" size="2" maxlength="2" id="edad" name="anios" readonly="t" class="color1">
<input type="text" size="2" maxlength="2" id="meses" name="meses" readonly="t" class="color1">
<input type="text" size="2" maxlength="2" id="dias" name="dias" readonly="t" class="color1">
</td>
</TR>
Valora esta pregunta


0