【问题标题】:How to redirect Google Custom Search Engine results to results.php page?如何将 Google 自定义搜索引擎结果重定向到 results.php 页面?
【发布时间】:2020-02-19 17:05:35
【问题描述】:

我创建了一个 Google CSE,搜索框位于网站的主页上。当用户搜索时,它应该将它们重定向到带有结果的 results.php,但是,它会将它们重定向到 cse.google.com/randomurl。

它被设置为具有两个页面格式,所以应该没有问题。我已尝试向我的表单添加操作,但没有成功。

<form class="form-inline" action="results.php" method="POST">
  <div class="md-form my-0">
    <script async src="https://cse.google.com/cse.js?cx=983049830948390:lxzkzf8ljowm"></script>
    <div class="gcse-searchbox-only"></div>
  </div>
</form>

*出于匿名目的,我在此问题中修改了我的自定义搜索引擎 URL。

【问题讨论】:

    标签: html google-custom-search


    【解决方案1】:

    documentation 显示如下:

    <div class="gcse-searchbox-only" data-resultsUrl="YOUR_RESULTS_PAGE_URL"></div>
    

    你有:

    <div class="gcse-searchbox-only"></div>
    

    【讨论】:

      猜你喜欢
      • 2011-06-07
      • 1970-01-01
      • 1970-01-01
      • 2012-02-25
      • 2010-10-30
      • 1970-01-01
      • 2021-01-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多