Why does the server not receive my data correctly?

Asked

Viewed 47 times

-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. Other order numbers do not appear. I have checked everything, which can 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>

  • Enter the full code...

  • I did. The rest of the code is firm, even recognizes the date and time, but the requests...

  • See if the attribute name inputs is not different from rescats by $_POST

  • Worse than not! Until because when I click on the name, the Notepad makes the direct link.

  • Enter the form code

  • Code added

  • 3

    I’m voting to close for typo, since the beginning of the tag <htlm> which does not exist, even the names of the wrong written fields, values and attributes. I suggest at least a little attention while typing before bringing the code here, saving colleagues' time. You are super welcome to ask your scheduling questions here, and we want to help, but first it is necessary that you Capriche a little more, for your own training, and better harnessing the knowledge of colleagues, achieving more autonomy to program, and best results here.

  • I do not usually comment when negative, but I will make an exception: I denied your question precisely by what Bacco quoted above, it seems that you have had a lot of inattention in your code, and this question can hardly help anyone solve a real problem (as this is a typo). Hence the negative. Understand that I am not negatively "your person", but the content. Votes are a qualitative one to assess whether the question is good or not. OK?

  • Don’t put it on! I was stupid. I’m starting to get the level of things around here, and I promise that a stupid problem like this will not happen again here, thank you!

  • @I’m glad you didn’t take it personally, this is very important to everything in life. Get on your side there, we’ll do whatever we can to help you when you need it. And over time, your doubts and posts will naturally improve, and along with that the score as well. Here are some cool tips when you have a little time to read: [Ask] and [Help]. And welcome to the network! Rest assured, that taking a "jolt" from the community in the first questions is super normal :)

Show 5 more comments

1 answer

2


On the server, it only recognizes the first request. Other order numbers do not appear. I have checked everything, which can be?

To answer your question: This is wrong:

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

It’s right in here:

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

You forgot to close the quotes. If you don’t put the names correctly, the formulário will not send the data correctly to the server. What’s more, you forgot to put the signal = in some attributes.

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

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

Yet there is another error in the other attributes, which is in the attribute size, that should be size="2" (forgot the sign of =).

  • Guy other than this error he’s not doing any while or for to return the order array, I think q ta missing Cod ai

  • Damn, that mistake beast! I don’t know how I didn’t see those quotes missing, thank you very much! And Jasar, I haven’t finished the code yet. I think it’s the Otepad that’s eating my lines when I replace something, but still, thanks!

  • It’s not the quotes is the sign of =...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.