
Notice: Undefined index:
Publicado por Angel (20 intervenciones) el 16/06/2015 06:25:01
hola a todos necesito su ayuda estoy tratando de hacer un programa pero me genera un error que dice Notice: Undefined index: seleccion in C:\wamp\www\UVIS\MDR\b_voluntarios.php on line 45 al enviar una variable a traves del metodo post este es el codigo en este codigo tengo dos radio button con el nombre seleccion donde cada uno realiza una consulta de busqueda segun el value que seleccione 1 o 2 si escojo la 1 debe realizarme la primera consulta caso contrario la segunda..
espero que me haya hecho entender y me puedad ayuda gracias de antemano.
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
if (isset($_POST['txt_caja'])) {
$colname_rsvoluntarios = $_POST['txt_caja'];
}
mysql_select_db($db, $cn);
if($_POST['seleccion']==1) este es la linea 45 la que me genera el error
{
//consulta 1
$query_rsvoluntarios = sprintf("SELECT ID_CARRERA, ID_FACULTAD, NOMBRE_CARRERA FROM carrera WHERE ID_FACULTAD=%s ORDER BY NOMBRE_CARRERA ASC", GetSQLValueString($colname_rsvoluntarios, "text"));
}
else
{
//consulta 2
$query_rsvoluntarios = sprintf("SELECT ID_CARRERA, ID_FACULTAD, NOMBRE_CARRERA FROM carrera WHERE NOMBRE_CARRERA LIKE %s ORDER BY NOMBRE_CARRERA ASC", GetSQLValueString("%" . $colname_rsvoluntarios . "%", "text"));
}
$rsvoluntarios = mysql_query($query_rsvoluntarios, $cn) or die(mysql_error());
$row_rsvoluntarios = mysql_fetch_assoc($rsvoluntarios);
$totalRows_rsvoluntarios = mysql_num_rows($rsvoluntarios);
?>
<!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/estilos4.css" rel="stylesheet" type="text/css" />
<script src="../SpryAssets/SpryEffects.js" type="text/javascript"></script>
<script type="text/javascript">
<!--
function MM_effectGrowShrink(targetElement, duration, from, to, toggle, referHeight, growFromCenter)
{
Spry.Effect.DoGrow(targetElement, {duration: duration, from: from, to: to, toggle: toggle, referHeight: referHeight, growCenter: growFromCenter});
}
//-->
</script>
</head>
<body onload="MM_effectGrowShrink('form1', 1000, '0%', '100%', false, false, true)">
<form id="form1" name="form1" method="post" action="">
<table width="415" border="0" align="center" class="tabla">
<tr>
<td colspan="2" class="titulo">Busqueda de Voluntarios</td>
</tr>
<tr>
<td width="107"><table width="107">
<tr>
<td width="99"><label>
<input type="radio" name="seleccion" value="1" id="seleccion_0" />
Cédula</label></td>
</tr>
<tr>
<td><label>
<input type="radio" name="seleccion" value="2" id="seleccion_1" />
Apellidos</label></td>
</tr>
</table></td>
<td width="300"><label>
<input name="txt_caja" type="text" id="txt_caja" size="50" maxlength="50" />
</label></td>
</tr>
<tr>
<td colspan="2" align="center"><label>
<input name="btn_buscar" type="submit" class="botones" id="btn_buscar" value="Buscar" />
</label></td>
</tr>
</table>
<table width="700" border="0" align="center" class="tabla">
<tr>
<td colspan="4" class="titulo">Listado de Voluntarios</td>
</tr>
<tr>
<td>Cedula</td>
<td>Apellidos</td>
</tr>
Valora esta pregunta


0