English 中文(简体)
• 如何展示“谷歌搜索”在我网站上的内容?
原标题:How to show Google Search results embedded in my website?
  • 时间:2012-04-05 12:49:30
  •  标签:
  • html
  • search

I am using this code in my website to show Google search results for my website :

<!-- Search block -->       
<div class="searchBox">
    <form method="get" action="http://www.google.com/search"> 
        <input type="text" name="query" class="searchField" />
        <input type="hidden" name="sitesearch" value="my_website.com">
        <input type="submit" value="" class="searchSubmit">
    </form>
</div>  

我喜欢这种简单的法典,而我不喜欢使用,而没有办法显示载于一页的这种搜索结果?

最佳回答
问题回答

可在网页上读到file_get_contents<>/code>,并读出你所需要的部分,并在您的网页上展示。

rel=“nofollow” http://php.net/manual/en/Function.file-get-contents.php

审视谷歌生态学(在撰写本报告时):

1.3 Your Obligations. You shall receive a Query from the End User and shall forward that Query to Google. You may not in any way frame, cache or modify the Results produced by Google, except as otherwise agreed to between You and Google.

顺便提一下,我不得不在标准圆顶页而不是我自己身上展示搜索结果。 参看Bing。

您可使用<代码>igu=1

例: 您是否想把“阿德莱”的结果纳入其中。

Your URL shoud look like this: https://www.google.com/search?igu=1&q=Adelle, where q=Adelle is the query you want to search and igu=1 is set to allow iframe embedding.

• 操作法典,以了解结果:

iframe {
width: 400px;
height: 200px;
border: 1px solid black;
border-radius: 5px;
}
With igu=1: <iframe src="https://www.google.com/search?igu=1&q=Adelle"></iframe>
<br>Without igu=1: <iframe src="https://www.google.com/search?q=Adelle"></iframe>




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签