Ver Mensaje Individual
  #5 (permalink)  
Antiguo 31/08/2011, 09:53
calixhh01
 
Fecha de Ingreso: abril-2011
Ubicación: Cix
Mensajes: 9
Antigüedad: 13 años
Puntos: 0
Respuesta: obtener valor de <select para php

Por favor, alguien quien me pueda ayudar le estaria muy agradecido. Tan solo intento que mostrar el id_libro del registro seleccionado de la lista de esta manera:

<h1>Seleccione los datos para la matricula del producto</h1>
<hr>
<?php
require("class.php");
$sql = "SELECT * FROM LIBROS";
$res = $cnx->query($sql) or die ($cnx->error);

echo "El numero es: " ?>$_POST['id_libro[]'];<?
?>
<form action="matricula.php" method="POST">

<select name="id_libro[]">
<?php
while($reg = $res->fetch_object()){?>
<option value="<?php echo $reg->id_libros?>"><?php echo $reg->nombre_libro?></option>
<?
}?>

</select>

<input type="submit" value="Grabar">
<table width="200" border="1" align="center">
<tr>
<td>Id de Libro</td>
<td>Id de editorial</td>
<td>Libro</td>
<td>Editorial</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
</form>


Pero no se porque no me carga =S