Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/04/2016, 09:35
shamy_18
 
Fecha de Ingreso: octubre-2014
Mensajes: 7
Antigüedad: 9 años, 6 meses
Puntos: 0
Pregunta Formulario de busqueda

hola amigos tengo un formulario de busqueda en php y conctada a mysql, el buscador me funciona bien pero antes de ingresar un numero y presionar el submit de buscar me sale:

Notice: Undefined index: busca in C:\xampp\htdocs\reg\buscador.php on line 14


esste es el codigo:

<form name="form1" method="post" action="buscador.php" id="cdr" >
<h3>Buscar por n° de notebook</h3>
<p>
<input name="busca" type="text" id="busqueda">
<input type="submit" name="Submit" value="buscar" />
</p>
</p>
</form>
<p>


<?php
$busca=" ";
$busca=$_POST["busca"];
mysql_connect("localhost","root","");
mysql_select_db("prestamo");
if($busca!=""){
$busqueda=mysql_query("SELECT * FROM consulta_notebook WHERE n_note = '".$busca."'");//cambiar nombre de la tabla de busqueda
?>
<table width="1166" border="1" id="tab">
<tr>
<td width="19">Rut </td>
<td width="61">Nombre</td>
<td width="157">Apellido</td>
<td width="221">N° de notebook</td>
<td width="176">N° de serie</td>
<td width="73">Codigo de barra</td>
<td width="118">Marca</td>
<td width="103">Fecha de salida</td>
</tr>

<?php

while($f=mysql_fetch_array($busqueda)){
echo '<tr>';
echo '<td width="19">'.$f['rut_pers'].'</td>';
echo '<td width="61">'.$f['nombre'].'</td>';
echo '<td width="157">'.$f['apellido'].'</td>';
echo '<td width="221">'.$f['n_note'].'</td>';
echo '<td width="176">'.$f['n_serie'].'</td>';
echo '<td width="73">'.$f['cod_barra'].'</td>';
echo '<td width="118">'.$f['marca'].'</td>';
echo '<td width="103">'.$f['fecha_s'].'</td>';
//onclick="return confirm('¿Realmente deseas eliminar este articulo?')";
//cambiar los nombres de los campos de busqueda
}

}
?>
</table>


Espero que me puedan ayudar gracias!!!