어떤 이유로 PHP에서 HTML 폼 입력을 날짜로 인식하지 못합니다.HTML 폼이 PHP 날짜로 전송되지 않습니다
나는 다음과 같은 HTML 양식있다 : 그러나 모든 반환
$DCity=(int) $_POST["DCity"];
$ACity=(int) $_POST["ACity"];
$DMonth=(int) $_POST["DMonth"];
$DDay=(int) $_POST["DDAY"];
$DYear=(int) $_POST["DYear"];
$DHour=(int) $_POST["DHour"];
$DMin=(int) $_POST["DMin"];
$DTime = mktime($DHour, $DMin, 0, $DMonth, $DDay, $DYear);
print date(DATE_RFC822, $DTime);
그 양식에 입력 된대로 반영해야한다에서 나는 가야 반환 :
<form action="Input.php" method="post">
Depature Date:
<select name="DMonth">
<option>- Select Month -</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>
<select name="DDay">
<option>- Select Day -</option>
<option value="01">1</option>
<option value="02">2</option>
<option value="03">3</option>
<option value="04">4</option>
<option value="05">5</option>
<option value="06">6</option>
<option value="07">7</option>
<option value="08">8</option>
<option value="09">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
<select name="DYear">
<option>- Select Year -</option>
<option value="2013">2013</option>
<option value="2014">2014</option>
<option value="2015">2015</option>
<option value="2016">2016</option>
<option value="2017">2017</option>
<option value="2018">2018</option>
<option value="2019">2019</option>
<option value="2020">2020</option>
<option value="2021">2021</option>
<option value="2022">2022</option>
</select><br>
Departure Time: <select name="DHour" input type="number">
<option>- Select Hour -</option>
<option value="00">12 a.m.</option>
<option value="01">1 a.m.</option>
<option value="02">2 a.m.</option>
<option value="03">3 a.m.</option>
<option value="04">4 a.m.</option>
<option value="05">5 a.m.</option>
<option value="06">6 a.m.</option>
<option value="07">7 a.m.</option>
<option value="08">8 a.m.</option>
<option value="09">9 a.m.</option>
<option value="10">10 a.m.</option>
<option value="11">11 a.m.</option>
<option value="12">12 p.m.</option>
<option value="13">1 p.m.</option>
<option value="14">2 p.m.</option>
<option value="15">3 p.m.</option>
<option value="16">4 p.m.</option>
<option value="17">5 p.m.</option>
<option value="18">6 p.m.</option>
<option value="19">7 p.m.</option>
<option value="20">8 p.m.</option>
<option value="21">9 p.m.</option>
<option value="22">10 p.m.</option>
<option value="23">11 p.m.</option>
</select>
<select name="DMin">
<option>- Select Minute -</option>
<option value="00">00</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="45">45</option>
</select>
<br>
<input type="submit" value="Submit">
</form>
다음과 같은 PHP를 현재 날짜와 시간입니다. 내 코드에 어딘가에 오류가 있습니까 ?? PHP 시간의 여러 가지 방법을 시도했지만 모든 HTML 폼에 입력 한 현재 날짜를 반환합니다.
각각의 $ _POST 변수 (또는'echo print_r ($ _ POST, 1);')가 제대로 설정되었는지 확인하기 위해 출력 했습니까? –