php - 带有自定义表单的 Google CSE

标签 php html forms search-engine google-custom-search

我的页面顶部有一个 GET 表单,但尚未配置。我所拥有的就是这个:

    <div class="top-search">
        <form  method="get" id="searchform" action="#">
            <div>
                <input type="text" value="Search..." name="s" id="s" onfocus="defaultInput(this)" onblur="clearInput(this)" />
                <input type="submit" id="searchsubmit" value=" " />
            </div>
        </form>
    </div>

我如何操纵它以使用 Google CSE?

最佳答案

似乎没有人决定回答这个问题,我自己找到了答案。

    <div class="top-search">
        <form id="searchform" action="http://www.google.com/cse">
            <div>
                <input type="hidden" name="cx" value="xxxx" />
                <input type="hidden" name="ie" value="UTF-8" />
                <input type="text" value="" name="q" id="q" autocomplete="off" />
                <input type="submit" id="searchsubmit" name="sa" value=" " />
            </div>
        </form>

    </div>

其中“xxxx”是您的搜索引擎唯一 ID,可在控制面板的“基本信息”页面上找到。

关于php - 带有自定义表单的 Google CSE,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14981575/

相关文章:

javascript - 如何让太阳的弧线停在页面的左端?

php - 如何使用 PHP 从 HTML 表单检查数据库记录

javascript - JQuery:如何不加入.submit中的特定字段

用于在文本字段上自动完成选择的 jQuery 监听器

PHP - 再次重新连接到 mySQL 或通过 POST 发送先前的内容?

jquery - UL 中的每个 LI 可以单独设置动画吗?

javascript - bootstrap popover 动态改变内容

PHP 模组重写

php - 使用 mysql 检查多个 Radio 值

email - 发送电子邮件时 PEAR 邮件身份验证失败