我想将所有3个$_POST
合并为1个变量但月份日不会出现,为什么会这样?
以下是代码:
<div id="register-birth-date">
<input type="number" name="register-day" placeholder="DATE">
<select id="register-month">
<option value="00">Mouth</option>
<option value="01">January</option>
<option value="02">February</option>
<option value="03">March</option>
<option value="04">April</option>
<option value="05">May</option>
<option value="06">June</option>
<option value="07">July</option>
<option value="08">August</option>
<option value="09">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
<input type="number" name=" " placeholder="YEARS">
</div>
$air_user_registered_date = $_POST['register-day']."/".$_POST['register-month']."/".$_POST['register-years'];
答案 0 :(得分:4)
您需要将name
属性添加到select box
个月和input box
多年。
<div id="register-birth-date">
<input type="number" name="register-day" placeholder="DATE" />
<select name="register-month" id="register-month">
<option value="00">Mouth</option>
<option value="01">January</option>
<option value="02">February</option>
<option value="03">March</option>
<option value="04">April</option>
<option value="05">May</option>
<option value="06">June</option>
<option value="07">July</option>
<option value="08">August</option>
<option value="09">September</option>
<option value="10">October</option>
<option value="11">November</option>
<option value="12">December</option>
</select>
<input type="number" name="register-years" placeholder="YEARS" />
</div>
答案 1 :(得分:2)
name
"register-day"
的日期文本框。
月份选择框提供name
的{{1}}。
年份文字框提供"register-month"
的{{1}}。