简体   繁体   English

带有SEO URL的Google自定义搜索

[英]Google Custom Search with SEO URL

Well i have this search engine into my site 好吧,我有这个搜索引擎进入我的网站

<form action="/apps/search/" name="g_search" id="cse-search-box" method="post">
    <input type="hidden" name="cof" value="FORID:11;NB:1" />
    <input type="hidden" name="ie" value="utf-8" />
    <input type="text" autocomplete="off" name="google_seach" class="search-text" onfocus="searchtext('focus')" onblur="searchtext('blur')" />
    <label style="color:#796b6b;float:left;padding:0;">|</label>
    <input type="submit" style="float:right;margin-top:3px;cursor:pointer;width:16px;height:16px;background:url(/template/img/main/search-icon.jpg);border:none;" value="" alt="Αναζήτηση" title="Αναζήτηση" />
</form>

Now i want some code to results page.Somehow the post request readed from a file called search.php This file have access to $_POST[] array.. 现在我想要一些代码到结果页面。以某种方式从名为search.php的文件中读取发布请求,该文件可以访问$ _POST []数组。

The file initializes $selector variable (for template use). 该文件初始化$ selector变量(供模板使用)。 What we want to echo into contentarea div must put into $body variable.. Any help? 我们要回显到contentarea div中的内容必须放入$ body变量中。.有什么帮助吗?

<?php
    $selector="search";
    $body="<div id=\"cse-search-form\" style=\"width: 100%;\">Loading</div>";
?>

我有一个类似的问题,请使用Google提供的GCS代码,因为它很简单,请确保在GSE中的选项中选择了可视化页面而非Iframe上的搜索结果

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM