Bueno estoy siguiendo un vídeo tutorial en http://www.illasaron.com/tele/php.htm
voy en el vídeo 3 y te enseñan a hacer un sistema de pedidos(compra) de libros
Este es mi formulario de pedidos:
Código HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type"
content="text/html; charset=ISO-8859-1">
<title></title>
</head>
<body>
<form action="comensandophp2.php" method=post>
<table style="text-align: left; width: 347px; height: 105px;"
border="1" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>Tabla de pedidos</td>
</tr>
<tr>
<td>
<table style="text-align: left; width: 100%;" border="1"
cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>Pedido 1</td>
<td><input name="pedidounoqty" type="text" size="3" maxlength="3"></td>
</tr>
</tbody>
</table>
<table style="text-align: left; width: 100%;" border="1"
cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>Pedido2</td>
<td><input name="pedidodosqty" type="text" size="3" maxlength="3"></td>
</tr>
</tbody>
</table>
<table style="text-align: left; width: 100%;" border="1"
cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td>Pedido3</td>
<td><input name="pedidotresqty" type="text" size="3" maxlength="3"></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<br>
<form name="form1" method="post" action="">
<label>Enviar pedido
<input type="submit" name="Submit" value="Enviar">
</label>
</form>
<p><br>
</p>
</body>
</html>
Ese es mi PHP :
Código PHP:
<html>
<head>
<title>Aprendiendo a Programar PHP</title>
</head>
<body>
<h1>Libreria Online</h1>
<h2>Resumen del pedido</h2>
<?
date_default_timezone_set('America/Los_Angeles');
echo "<p>Orden Procesada.";
echo date("H:i ");
echo "del dia ";
echo date("j ");
echo "de ";
echo date("F ");
echo "del año ";
echo date("Y");
echo "<br>";
echo $pedidounoqty." Pedidonumerouno<br>";
echo $pedidodosqty." Pedidonumerodos<br>";
echo $pedidotresqty." Pedidonumerotres<br>";
?>
</body>
</html>
Ahora el problema viene aquí, a la hora de enviar el valor de cantidad en el formulario de pedidos no se muestra la cantidad de pedidos, al menos que agregue esta linea
ejemplo:
Código PHP:
$pedidounoqty=$_REQUEST['pedidounoqty']; //Esta linea
echo $pedidounoqty." Pedidonumerouno<br>";
Y en el vídeo tutorial demuestran que se puede hacer con solo esta linea sin ningún problema
Código PHP:
echo $pedidounoqty." Pedidonumerouno<br>";
Ojala me haya dejado entender xP, espero aclarar esta duda y gracias desde ya :)
PD: Recién me estoy iniciando en el mundo del PHP y la verdad me gusta muchísimo
Ah! y otra cosa el vídeo tutorial tiene 4 años de antigüedad, me conviene seguir?