Foros del Web » Programando para Internet » PHP »

[SOLUCIONADO] No me funciona otro boton!! que hago ?

Estas en el tema de No me funciona otro boton!! que hago ? en el foro de PHP en Foros del Web. Hola!! lo que pasa esque traigo los dato por url le doy buscar y si lo hace pero le doy a otro boton y me ...
  #1 (permalink)  
Antiguo 30/08/2013, 06:46
 
Fecha de Ingreso: agosto-2013
Mensajes: 3
Antigüedad: 10 años, 7 meses
Puntos: 0
No me funciona otro boton!! que hago ?

Hola!!

lo que pasa esque traigo los dato por url le doy buscar y si lo hace pero le doy a otro boton y me dice
Notice: Undefined index: cedula in \.....\vista\AcudienteV.php on line 6
No se que hacer
anexo codigo


modelo
Código PHP:
Ver original
  1. function Buscar($valor) {
  2.                        
  3.                         $sql = "select cedula,nombre,apellido,telefono from acudiente where cedula='".$valor."'";
  4.                         $rs = mysql_query($sql, $this->conn);
  5.                         while ($row = mysql_fetch_row($rs)) {
  6.                          $var=$row[0];
  7.                          $var1=$row[1];
  8.                          $var2=$row[2];
  9.                          $var3=$row[3];
  10.                         }
  11.                     echo "<script>
  12.                     location.href=\"../vista/AcudienteV.php?      cedula=$var&nombre=$var1&apellido=$var2&telefono=$var3\";
  13.                     </script>";
  14.     }
vista
Código PHP:
Ver original
  1. <?php
  2.  
  3.     require "../control/AcudienteC.php";
  4.     $modelo = new Modelo();
  5.        
  6.     $var=$_GET['cedula'];
  7.     $var1=$_GET['nombre'];
  8.     $var2=$_GET['apellido'];
  9.     $var3=$_GET['telefono'];
  10.    
  11.  ?>
  12.  
  13.  
  14. <HTML>
  15.      
  16.     <head>
  17.     <script language="JavaScript" type="text/javascript" src="../vista/ajax.js">  </script>
  18.        <title> Acudientes </title>
  19.  
  20.     </head>
  21.  
  22.     <form name = "formula" id = "formula" method = "POST" action = "../control/AcudienteC.php">
  23.         <font>
  24.                <b>Acudiente</b>
  25.                <br>
  26.  
  27.                <br/>
  28.  
  29.                <table>
  30.                
  31.                <tr>
  32.                    <td> Cedula </td>                   
  33.                     <td> <input id="cedula" type = "text" name = "Cedula" value="<?php  echo $var?>"/> </td>                                 
  34.                 </tr>
  35.  
  36.                 <tr>
  37.                    <td> Nombre </td>
  38.                    <td> <input id = "Nombre" type = "text" name = "Nombre" value="<?php  echo $var1?>"/> </td>               
  39.                 </tr>
  40.  
  41.                 <tr>
  42.                    <td> Apellido </td>
  43.                    <td> <input id = "Apellido" type = "text" name = "Apellido" value="<?php  echo $var2?>"/> </td>               
  44.                 </tr>
  45.                
  46.                 <tr>
  47.                    <td> Telefono</td>
  48.                    <td> <input id = "Telefono" type = "text" name = "Telefono" value="<?php echo $var3?>"/> </td>                
  49.                 </tr>
  50.                
  51.                 <tr>
  52.                 <td>Buscar por Cedula</td>
  53.                 <td> <input id="Valor" type="text" name="Valor"/>
  54.                 <td> <input type = "submit" value = "Buscar" name = "Buscar"/> </td>    
  55.        
  56.                </table>
  57.  
  58.                <table>
  59.                 <tr>
  60.                     <td> <input type = "submit" value = "Insertar" name = "Insertar"/> </td>
  61.                     <td> <input type = "submit" value = "Borrar" name = "Borrar"/> </td>
  62.                     <td> <input type = "submit" value = "Modificar" name = "Modificar"/> </td>
  63.                     <td> <input type = "submit" value = "Listar" name = "Listar"/> </td>               
  64.                 </tr>
  65.                </table>
  66.  
  67.               <table>
  68.                 <br>
  69.                 <tr>
  70.                 <td align = "center"><h3>cedula</h3></td>
  71.                 <td align = "center"><h3>nombre</h3></td>
  72.                 <td align = "center"><h3>apellido</h3></td>
  73.                 <td align = "center"><h3>telefono</h3></td>
  74.                 </tr>
  75.                
  76.                 <?php
  77.                    $modelo->listarAcudientesM();
  78.                 ?>
  79.                
  80.                </table>
  81.         <font>
  82.     </form>
  83. </HTML>

ayuda por fa!!

Última edición por Triby; 31/08/2013 a las 20:31 Razón: Código en highlight
  #2 (permalink)  
Antiguo 31/08/2013, 20:35
Avatar de Triby
Mod on free time
 
Fecha de Ingreso: agosto-2008
Ubicación: $MX->Gto['León'];
Mensajes: 10.106
Antigüedad: 15 años, 8 meses
Puntos: 2237
Respuesta: No me funciona otro boton!! que hago ?

Al parecer tienes unos espacios al generar la URL de destino.

Luego, si no has enviado salida al navegador, sería más conveniente hacer la redirección desde PHP:

Código PHP:
Ver original
  1. header("Location: ../url/de/destino.php?variables...");
  2. exit; // Finalizar la ejecución del script
__________________
- León, Guanajuato
- GV-Foto

Etiquetas: boton, html, mysql, select, sql
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 19:26.