954,595 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Search results in iframe

Hi.
I'm trying to make a simple page that contains a google search form. The results of the search needed to be shown in an iframe that is on the same page. I've managed to write the search form but I can't make the results appear in the iframe. Whenever i click search it just opens the google search page.
What do i miss here?

<html>
<head>
	<title>My Searhpage</title>
</head>
<body>
	<h1 align="center">Google Search</h1>
	<form action="http://www.google.com/search" method="get" enctype="text">
		<input type="text" name="q">
		<input type="submit" value="Search">
	</form>
	<iframe src="https://www.google.com/search?q=" width="800" height="600">
</body>
</html>

Please help.
Thanks in advance =)

akvilio
Newbie Poster
8 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

when i used ur code, google says, that it cannot load the results page in a frame.

Even I tried to add iframe name and use form target to that name.

You can directly login to google and use their readymade codes for your requirement.

carrieathomer
Light Poster
37 posts since Oct 2011
Reputation Points: 11
Solved Threads: 8
 

The trick is to do it myself. i'm in a learning process, wanted to get more experienced opinion and help... but thanks anyway =)

akvilio
Newbie Poster
8 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

This is good that you want to do it for learning. But there are some restriction by Google to avoid this, please read the following for reason:

https://groups.google.com/a/googleproductforums.com/forum/#!category-topic/picasa/picasa-web-albums/0QmMs08XOfg

sufyan2011
Junior Poster
166 posts since Dec 2011
Reputation Points: 9
Solved Threads: 20
 

Got it, thanks! Anyway, I figured it out with "target" and "name" attributes.

akvilio
Newbie Poster
8 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

Did it work?

rotten69
Posting Whiz
346 posts since May 2011
Reputation Points: 3
Solved Threads: 16
 

No. As sufyan2011 said, google don't allow their result pages be displayed in iframes as a security precaution.

akvilio
Newbie Poster
8 posts since Jul 2010
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You