具有自定义格式的Google CSE

问题描述 投票:2回答:2

我在页面顶部有一个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?

php html forms search-engine google-custom-search
2个回答
7
投票

[似乎没有人决定回答,我自己找到了。

    <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,可在控制面板的“基本”页面上找到。


0
投票

谢谢!但是,尽管在cse中选择了叠加,但它会以整页显示。有没有办法让结果以重叠样式显示?

© www.soinside.com 2019 - 2024. All rights reserved.