Why does not the server receive my data correctly? [closed]

-2
<htlm>
<head>

<title>Horta do Bob - Resultado da compra </title>
</head>
<body>
<h1>Horta do Bob </h1>
<h2> Resultado da compra </h2>

<?php

//cria nomes de variável abreviados
$Salameqty = $_POST['Salameqty'];
$Manjericãoqty = $_POST['Manjericãoqty'];
$Abobrinhaqty = $_POST['Abobrinhaqty'];

 echo '<p>Resultado processado em ';
 echo date('H:i, jS F');
  echo '</p>';

echo '<p>Confira seu pedido: </p>';

echo $Salameqty.' Salames<br />';
echo $Manjericãoqty.' Manjericões<br />';
echo $Abobrinhaqty.' Abobrinhas<br />';


?>

</body>
</head>

On the server, it only recognizes the first request. The other order numbers do not appear. I've already checked everything, what can it be?

------ Form Code (Disguise Simplicity)

<form action="processorder.php" method=post>
<table border=5>
<tr bgcolor=#0091C9>
 <td width=100>Lanche</td>
 <td width=100>Quantos?</td>
</tr>

 <tr>
 <td>Salame</td>
 <td align="center"><input type="text" name="Salameqty" size"2" maxlenght="5"></td>
 </tr>

 <tr>
 <td>Manjericão</td>
 <td align="center"><input type="text" name="Manjericãoqty size"2" maxlenght="2"></td>  
 </tr>

 <tr>
 <td>Abobrinha</td>
 <td align="center"><input type="text" name="Abobrinhaqty size"2" maxlenght=2"></td>
 </tr>

 <tr>
 <td colspan="2" align="center"><input type="submit" value="Processar pedido">
 </td>

       

    
asked by anonymous 27.09.2016 / 17:46

1 answer

2
  

On the server, it only recognizes the first request. The other order numbers do not appear. I've already checked everything, what can it be?

Responding to your question: This is wrong here:

 <input type="text" name="Abobrinhaqty size"2" maxlenght=2">

The right thing to do here:

<input type="text" name="Abobrinhaqty" size="2" maxlength=2">

You forgot to close the quotation marks. If you do not put the names correctly, formulário will not send the data correctly to the server. What's more, you forgot to put the = sign on some attributes.

This is the error in your code. The first one is appearing in the server response because it was declared correctly (at least the name field is right).

 <input type="text" name="Salameqty" size"2" maxlenght="5">

There is still another error in the other attributes, which is in the size attribute, which should be size="2" (forgot the = sign).

    
27.09.2016 / 18:21