一页上的多个表单,以提交一个

时间:2015-06-20 13:01:58

标签: forms post

我在一个网站上有多个表单时遇到问题, 我只打算提交一份。 我对html的输出是:



<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> 
		
&#13;
&#13;
&#13;

在着陆页上,我想做类似的事情:

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

但我的字符串中没有任何内容。

1 个答案:

答案 0 :(得分:0)

唉... 正如我上次评论中提到的那样:

缺少名称标签,之后,它正常工作。