deniz946
Gamma
Redactor
Buenas noches compañeros, estoy aprendiendo php con un libro que cogi de la biblioteca de la politecnica, he empezado todo bien, he instalado el xampp y el wampp y con ambos estoy teniendo un problema que he buscado y buscado y no encunetro una solucion. El problema es que tengo un archivo html con un formulario simple que te pide 3 cositas y el boton de submit que al darle te redirecciona a otra pagina en php, el problema es que al darle a submit en vez de abrirme la pagina php me salta la opcion de mozilla para descargar, en chrome pasa lo mismo. Pero si voy directamente al archivo en plan localhost/miarchivo.php asi si que funciona, no se como solucionar esto, me podríais echar una mano por favor? Aqui os dejo el codigo del archivo php y del html
archivo html
archivo php
archivo html
Insertar CODE, HTML o PHP:
<html>
<header>
<title>Bob's</title>
</header>
<body>
<form action="processorder.php" method="post">
<table border="0">
<tr bgcolor="#cccccc">
<td width="150">Item</td>
<td width="15">Quantity</td>
</tr>
<tr>
<td>Tires</td>
<td align="center"><input type="text" name="tireqty" size="3"
maxlength="3"></td>
</tr>
<tr>
<td>Oil</td>
<td align="center"><input type="text" name="oilqty" size="3" maxlength="3"></td>
</tr>
<tr>
<td>Spark Plugs</td>
<td align="center"><input type="text" name="sparkqty" size="3"
maxlength="3"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Submit Order"></td>
</tr>
</table>
</form>
</body>
</html>
archivo php
Insertar CODE, HTML o PHP:
<html>
<head>
<title>Bob's Auto Parts - Order Results</title>
</head>
<body>
<h1>Bob's Auto Parts</h1>
<h2>Order Results</h2>
<?php
echo '<p>Order processed at ';
echo date('H:i, jS F');
echo '</p>';
echo "Your order is: ";
echo "$tireqty tires \n";
echo "$oilqty bottles of oil \n";
echo "$sparkqty spark plugs \n";
?>

