Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/03/2011, 15:45
expecimen
 
Fecha de Ingreso: octubre-2006
Ubicación: Ciudad Ojeda, Venezuela
Mensajes: 123
Antigüedad: 17 años, 6 meses
Puntos: 0
Buscador php con text y select

Hola de nuevo, bien les explico tengo un buscador en php que me hace consulta a una BD SQL el cual cuando le coloco el numero de planilla (Id) me da los resultados en una planilla ya diseñada sin problema...




bien ahora el problema es que hay dos tipos de planilla y lo que trato de hacer es un buscador don un text (donde se coloca el numero de planilla a buscar) y un select que es en donde selecciona a que planilla o pagina php va mostrar los resultados he tratado de hacerlo mediante un java script en el button (boton de envio) pero no me funciona, me arroja el resultado en blanco y con error en la linea numero 11

linea 11: $registros=mysql_query("select * from iyc where Id='$_REQUEST[Id]'",$conexion) or



Aquí les dejo el código del buscador que realice:

Código HTML:
<body topmargin="0">

<form method="POST" name="buscar" onsubmit="return validar();">
	<div align="center">
		<table border="0" width="417" Id="table5" cellspacing="1" bgcolor="#FFFFFF" height="30">
			<tr>
				<td align="center" height="28" width="413">
				<table border="0" width="712" Id="table6" cellspacing="0" cellpadding="0">
					<tr>
						<td height="26" width="190">&nbsp;</td>
						<td height="26" width="148">
						&nbsp;</td>
						<td height="26" width="114">
						&nbsp;</td>
						<td height="26" width="261">
						&nbsp;</td>
					</tr>
					<tr>
						<td height="26" width="190"><b>
						<font size="2" face="Verdana">
						<p align="justify"><font face="Tahoma" size="5">PLANILLA 
						N°:</font></font></b></p>
						</td>
						<td height="26" width="148">
						<input type="text" name="Id" size="20"></td>
						<td height="26" width="114">
						<p align="center">
						<font size="2" face="Verdana" color="#FF0000"><b>
						<select size="1" name="D3">
						<option value="../pagina01_1.php">declara 01</option>
						<option value="../pagina01_2.php">declara 02</option>
						</select></b></font></p>
						</td>
						<td height="26" width="261">
						<font size="2" face="Verdana" color="#FF0000"><b>
						<input type="button" value="BUSCAR" onclick="location=D3.options[D3.selectedIndex].value"></b></font></td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
	</div>
</form>

</body> 
código php de la pagina donde muestra los resultados:

Código PHP:
<?php
session_start
();
include(
'../../../config/ln.php');
require_once(
'../../../config/config.php');
$conexion=mysql_connect(DB_HOSTDB_USERDB_PASSWORD) or
die(
"Problemas en la conexion");

mysql_select_db(DB_DATABASE,$conexion) or
die(
"Problemas en la selección de la base de iyc");

$registros=mysql_query("select * from iyc where Id='$_REQUEST[Id]'",$conexion) or
die(
"Problemas en el select:".mysql_error());
if (
$reg=mysql_fetch_array($registros))
{
}
else
echo 
"IDE NO REGISTRADO";
?>
Espero me puedan ayudar