Programación Web y Scripting > PHP

 No Funciona Buscador??????

(1/1)

neorent:
hola amigos del foro, bueno aqui con otro problema, estoy haciendo una buscador exacto y no me funciona segun yo el code esta ok pero no se que pasa, bueno les dejo el code para me digan si hay algo malo en el o definitivamente esta malo mi pc, gracias

bueno este es el formulario donde paso el valor al buscar
se llama fbusqueda.php


--- Código: Text --- <html><head><title>Solicitudes de mantención</title></head><style type="text/css"><!--.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; }--></style> <body><?php include("formato.php"); ?> <?php CabeceraPagina(); ?> <h3>Buscar Solicitud </h3><form action="buscador.php" method="POST" name="frm" id="buscado">  <span class="style1"><strong>Nº Solicitud:</strong></span>   <input name="buscado" type="text" id="buscado" size="10" maxlength="10">  <br>  <br> <input name="buscar" type="submit" id="buscar" value="Buscar"> </form><?php PiePagina(); ?></body> </html>  
y este es el code donde hago la busqueda y posterio impresion por pantalla.


--- Código: Text --- <html><style type="text/css"><!--.style13 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; }--></style> <body> <?php include("formato.php"); ?> <?php CabeceraPagina(); ?> <?php if (!isset($buscado)){   echo "<p>Debe ingresar un Nº de Solicitud.</p> \n";  echo "<p><a href=fbusqueda.php>Volver</p> \n";   echo "</html></body> \n";   exit; }$link = mysql_connect("localhost", "root", ""); mysql_select_db("db_soporte", $link); $sql = "SELECT folio FROM tbl_maestra WHERE (folio = '$buscado')"; $result = mysql_query($sql, $link); ?>     <TABLE height="5%" BORDER=1 CELLPADDING=0 CELLSPACING=0>       <TR>        <TD width="100"><span class="style13"> Nº Solicitud  </span></TD>        <TD width="100"><span class="style13"> Fecha  </span></TD>        <TD width="150"><span class="style13"> Solicitante </span></TD>        <TD width="100"><span class="style13"> Cargo </span></TD>        <TD width="150"><span class="style13"> Dir. / Depto. </span></TD>        <TD width="100"><span class="style13"> Sistema </span></TD>    <TD width="100"><span class="style13"> Solicitud </span></TD>    <td width="200"><span class="style13"> Estado </span></td>      </TR><?php          while($row = mysql_fetch_array($result)) {       printf("<tr>          <td><span class='style13'> %s</span></td>        <td><span class='style13'> %s</span></td>        <td><span class='style13'> %s</span></td>        <td><span class='style13'> %s</span></td>        <td><span class='style13'> %s</span></td>        <td><span class='style13'> %s</span></td>        <td><span class='style13'> %s</span></td>        <td><span class='style13'> %s</span></td>      </tr>",      $row["folio"],      $row["fecha_solicitud"],      $row["hora_solicitud"],      $row["nombre_usuario"],      $row["depto_usuario"],      $row["tipo_requerimiento"],      $row["tecnico_asignado"],      $row["estado_atencion"]);} echo "<p><a href=fbusqueda.php>Volver</p> \n"; ?> </table><?php PiePagina(); ?> </body></html>  

neorent:

--- Cita de: "neorent" --- hola amigos del foro, bueno aqui con otro problema, estoy haciendo una buscador exacto y no me funciona segun yo el code esta ok pero no se que pasa, bueno les dejo el code para me digan si hay algo malo en el o definitivamente esta malo mi pc, gracias

bueno este es el formulario donde paso el valor al buscar
se llama fbusqueda.php


--- Código: Text --- <html><head><title>Solicitudes de mantención</title></head><style type="text/css"><!--.style1 {font-family: Verdana, Arial, Helvetica, sans-serif}.style3 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; }--></style> <body><?php include("formato.php"); ?> <?php CabeceraPagina(); ?> <h3>Buscar Solicitud </h3><form action="buscador.php" method="POST" name="frm" id="buscado">  <span class="style1"><strong>Nº Solicitud:</strong></span>   <input name="buscado" type="text" id="buscado" size="10" maxlength="10">  <br>  <br> <input name="buscar" type="submit" id="buscar" value="Buscar"> </form><?php PiePagina(); ?></body> </html>  
y este es el code donde hago la busqueda y posterio impresion por pantalla.


--- Código: Text --- <html><style type="text/css"><!--.style13 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: x-small; }--></style> <body> <?php include("formato.php"); ?> <?php CabeceraPagina(); ?> <?php if (!isset($buscado)){   echo "<p>Debe ingresar un Nº de Solicitud.</p> \n";  echo "<p><a href=fbusqueda.php>Volver</p> \n";   echo "</html></body> \n";   exit; }$link = mysql_connect("localhost", "root", ""); mysql_select_db("db_soporte", $link); $sql = "SELECT folio FROM tbl_maestra WHERE (folio = '$buscado')"; $result = mysql_query($sql, $link); ?>     <TABLE height="5%" BORDER=1 CELLPADDING=0 CELLSPACING=0>       <TR>        <TD width="100"><span class="style13"> Nº Solicitud  </span></TD>        <TD width="100"><span class="style13"> Fecha  </span></TD>        <TD width="150"><span class="style13"> Solicitante </span></TD>        <TD width="100"><span class="style13"> Cargo </span></TD>        <TD width="150"><span class="style13"> Dir. / Depto. </span></TD>        <TD width="100"><span class="style13"> Sistema </span></TD>    <TD width="100"><span class="style13"> Solicitud </span></TD>    <td width="200"><span class="style13"> Estado </span></td>      </TR><?php          while($row = mysql_fetch_array($result)) {       printf("<tr>          <td><span class='style13'> %s</span></td>        <td><span class='style13'> %s</span></td>        <td><span class='style13'> %s</span></td>        <td><span class='style13'> %s</span></td>        <td><span class='style13'> %s</span></td>        <td><span class='style13'> %s</span></td>        <td><span class='style13'> %s</span></td>        <td><span class='style13'> %s</span></td>      </tr>",      $row["folio"],      $row["fecha_solicitud"],      $row["hora_solicitud"],      $row["nombre_usuario"],      $row["depto_usuario"],      $row["tipo_requerimiento"],      $row["tecnico_asignado"],      $row["estado_atencion"]);} echo "<p><a href=fbusqueda.php>Volver</p> \n"; ?> </table><?php PiePagina(); ?> </body></html>  
--- Fin de la cita ---
BUENO YA RESOLVI EL PROBLEMA NO SE PASABA LA VARIABLE CON LOS DATOS ASI QUE PUSE ESTO U FUNCIONO.

$i_buscado=$_REQUEST['buscado'];

GRACIAS POR LA AYUDA A TODOS ADIOS

Navegación

[0] Índice de Mensajes

Ir a la versión completa