WordPress and GET


WordPress and GET

我在WP中有表单和页面(模板页面)。通过表单,我想要发送值GET,然后页面创建查询。

形式:

<form id="homepage_form" method="get">
    <input type="hidden" name="p" value="48" />
    <input class="first" type="text" name="name" />
    <input type="text" name="location"/>
    <select name="category">
        <option value="0" disabled selected>Kategori</option>
    </select>
    <input class="btn" type="submit" value="Search" />
</form>

第一个问题。我需要在表单中发送ID页面吗?(输入类型="隐藏"名称="p"值="48")。也许是其他方法。

第二个问题。当我发送此表单时,我看到了"page_id_48/?location=asdasd"。WP被盗的第二个GET(名称)。

现在我知道了...我不喜欢WP中的表单,或者我不明白。

你需要属性值,才能得到它。

<input class="first" type="text" name="name" value="something" />

在 WP 中无法发送获取"名称"

<input class="first" type="text" name="name" /><-坏

<input class="first" type="text" name="notname" /> <- 好的