我想知道是否有人能帮忙我正在尝试使用一个带有get
函数的表单,但运气不太好。
这是我的代码
<div class="row-fluid search-forms search-default">
<form class="form-search" method="get" action="search_results.php">
<div class="chat-form">
<div class="input-cont">
<input type="text" placeholder="Search..." class="m-wrap" />
</div>
<button type="button" class="btn green">Search <i class="m-icon-swapright m-icon-white"></i></button>
</div>
</form>
</div>
搜索将我带到右侧页面,但在?q=
之后没有任何内容
知道吗?
您尚未为输入提供名称。因此,它没有任何可添加到GET中的内容。将属性name="添加到标记中。
您必须添加name="q":
<input type="text" placeholder="Search..." name="q" class="m-wrap" />