-1

I have trouble with having multiple forms on one site, I only intend to submit one of it. My output to html is:

<section class="section-1">
<h3>double room</h3>
<p>230.00 €</p>
<form id="booking_form_1" method="post" action="/booking/booking_form">
<input id="start_date" value="1434804140" type="hidden">
<input id="end_date" value="1434890540" type="hidden">
<input id="resource_id" value="301" type="hidden">
<input id="price" value="230.00" type="hidden">
<input id="booking_form_1" class="btn btn-lg btn-success" value="book" type="submit">
</form>
</section>

<section class="section-2">
<h3>single room</h3>
<p>230.00 €</p>
<form id="booking_form_2" method="post" action="/booking/booking_form">
<input id="start_date" value="1434804140" type="hidden">
<input id="end_date" value="1434890540" type="hidden">
<input id="resource_id" value="303" type="hidden">
<input id="price" value="230.00" type="hidden">
<input id="booking_form_2" class="btn btn-lg btn-success" value="book" type="submit">
</form>
</section>

<section class="section-3">
<h3>trible room</h3>
<p>250.00 €</p>
<form id="booking_form_3" method="post" action="/booking/booking_form">
<input id="start_date" value="1434804140" type="hidden">
<input id="end_date" value="1434890540" type="hidden">
<input id="resource_id" value="302" type="hidden">
<input id="price" value="250.00" type="hidden">
<input id="booking_form_3" class="btn btn-lg btn-success" value="book" type="submit">
</form>
</section> 
  

On the landing page I would like do something like:

<?php 
$start_date = $_POST['start_date'];
echo $start_date;
?>

But I do not get anything in my string.

bytecode77
  • 14,163
  • 30
  • 110
  • 141
tomtom
  • 99
  • 1
  • 1
  • 10
  • You may want to look up how forms work. – Anonymous Jun 20 '15 at 13:10
  • I think what you are looking for has already been answered [here](http://stackoverflow.com/questions/8712398/multiple-forms-or-multiple-submits-in-a-page). – Alp Jun 20 '15 at 13:15
  • @Alp thanks for the link, I came across this before but unfortunately I don't get where my mistake is, or what I am doing wrong. – tomtom Jun 20 '15 at 13:21
  • Well... the only thing wrong are the missing name tags. I was assuming id is the identifier. Can't believe it took me so long with name tags its working fine – tomtom Jun 20 '15 at 18:28

1 Answers1

0

Well... As mentioned in my last comment:

The name tags are missing, after that, it is working fine as is.

tomtom
  • 99
  • 1
  • 1
  • 10