Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple forms POST vs GET

Status
Not open for further replies.

barryp

Programmer
Jan 30, 2002
48
GB
Hi
Can anyone see the problem here ?
If I click on the submit in the first form I get the hidden datafield value=1 sent to my editHotel.php script.
HOWEVER if I use method=GET it works !!!
BUT I want method=POST please.

<table border="1">
<tr>
<td>name</td>
<td>tel</td>
<td>postcode</td>
</tr>
<tr>
<td>Hotel Prima</td>
<td>09990888</td>
<td>sa56dd</td>
<td><form action="editHotel.php" method="post" enctype="multipart/form-data" name="editHotel" target="_self">
<input name="hotelID" type="hidden" value="2">
<input name="edit" type="submit" value="Edit">
</form></td>
</tr>
<tr>
<td>Hotel Splendide</td>
<td>10292423394</td>
<td>sa2 8ac</td>
<td><form action="editHotel.php" method="post" enctype="multipart/form-data" name="editHotel" target="_self">
<input name="hotelID" type="hidden" value="1">
<input name="edit" type="submit" value="Edit">
</form></td>
</tr>
</table>
 
This is a PHP question and as such should be addressed in the PHP forum: forum434. But i will try to answer it here anyway.

From your php page instead of doing $_GET['HotelID'] to get the value from your form do $_POST['HotelID']

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Vacunita
Thanks - how did you know ? Iam trying to learn DreanWeaver & didn't know until I looked at the code it produced that it was expecting a GET not a POST !
 
It was a simple matter of deductive reasoning. In any case glad you sorted it out.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top