dongluan0020 2014-07-25 03:05
浏览 40
已采纳

PHP GET提交错误

Ok, I'm trying to program a php page that will allow the user to pick a season and an episode from a form. Then It sends it to a page that plays them all.

Here is the form:

<form action="view" method="get">
<select>
 <option name="s" id="s" value="1">1</option>
</select>
<select>
 <option name="e" id="e" value="1">1</option>
</select>
<input type="submit" value="GO">
</form>

I'll add the other seasons and episodes in later. When they submit the form to the page VIEW, it sends it to the url and adds the question mark, but doesn't define the variables like so

http://127.0.0.1/media/show/view/?

I've never had this issue before, how do I get it to define the variables using GET in the url? I'm sure I'm missing something simple... Also, I've manually defined the variables in the url and my videos play just fine.

  • 写回答

1条回答 默认 最新

  • douduikai0562 2014-07-25 03:08
    关注

    As I stated in the comments, you can't have a name attribute on an option. You should construct your select elements like this:

    <select name="s">
     <option id="s" value="1">1</option>
    </select>
    <select name="e">
     <option id="e" value="1">1</option>
    </select>
    

    That will append them to your url correctly.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 MATLAB中streamslice问题
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端
  • ¥15 基于PLC的三轴机械手程序