duanke1984 2014-05-18 18:33
浏览 17

PHP $ _POST收到404错误

I am trying to practice my php form interaction and I ran into a little snag. This code works fine when I take out the month and the day selections however when I leave them in I get a 404 Page Not Found Error.

 <?PHP 
 if ($_POST['Submit']){ // if the form was submitted
    echo $_POST['homeTeam'];
    echo $_POST['awayTeam'];
    echo $_POST['matchDate'] . ' ';
    echo $_POST['month'] . ' ';
    echo $_POST['day'] . ', ';
    echo $_POST['year'];
  }
 else { //if the form hasn't been submitted yet
 ?>
 <form action="" method="post" id="addMatch">
 <label id="homeTeam">Home: <input type="text" name="homeTeam" /></label> 
 <label id="awayTeam">Away: <input type="text" name="awayTeam" /></label>

 <label id="month">Month:
 <select name="month">
    <?php foreach(range(1,12) as $month){ 
      echo '<option value="' . $month . '">' . date("F",strtotime("0000-$month")) . '</option>';
    }
    ?>
 </select></label>


 <label id="day">Day:
 <select name="day">
    <?php foreach(range(1,31) as $day){
       echo '<option value="' . $day . '">' . $day . '</option>';
    }
    ?>
 </select></label> 


 <input type="hidden" name="year" value="2014" />
 <input type="submit" name="Submit" />
 </form> 
 <?php 
 }
 ?>

I've tried rewriting the code a couple of different ways and always the same result.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 Vue3 大型图片数据拖动排序
    • ¥15 划分vlan后不通了
    • ¥15 GDI处理通道视频时总是带有白色锯齿
    • ¥20 用雷电模拟器安装百达屋apk一直闪退
    • ¥15 算能科技20240506咨询(拒绝大模型回答)
    • ¥15 自适应 AR 模型 参数估计Matlab程序
    • ¥100 角动量包络面如何用MATLAB绘制
    • ¥15 merge函数占用内存过大
    • ¥15 使用EMD去噪处理RML2016数据集时候的原理
    • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大