PDA

View Full Version : <iframe> source as google search



VatsaL
01-14-2007, 12:53 AM
hello everyone :)

I am trying to make a page which would take a "entered" on search query from the previous page and display results in google with that query in an <iframe> in the results.htm page.

So if I enter the word "watches" into a textbox, the google search results would be displayed in an <iframe> in the results.htm page for the word "watches" with something like http://www.google.com/search?q= for "textValue".

I have did set up a demo, but was having all kinds of problem s with displaying the appropriate query in an <iframe>, so at the moment the results page is without any iframes.

here is the demo http://scratchpad.50webs.com/iframe

I tried all sorts of stuff, played around with javascript, but nothing. Scanned a million forums through google, but still nothing.

How can I make the <iframe> on the "results.htm" page to display the google search for the entered word, automatically when the page loads, and still have the textbox on results.htm fill up with the passed textbox value from the first page?

thanks a bunch!!
vat

thetestingsite
01-14-2007, 01:51 AM
Not quite sure how you would do that in just HTML, not even sure if it's possible. But I am pretty sure it isn't. You could probably do it using SSI (server-side includes) or any sever-side languages.

VatsaL
01-14-2007, 02:07 AM
Not quite sure how you would do that in just HTML, not even sure if it's possible. But I am pretty sure it isn't. You could probably do it using SSI (server-side includes) or any sever-side languages.

Well, I did digg out something much similar, here s another demo, using iframes:

http://scratchpad.50webs.com/frames

but, the only problem is, that the script displays 2 iframes, but I just want the results.htm page [in http://scratchpad.50webs.com/frames] to display only ONE <iframe> which is the google search.

the main problem here arises, when I can't even pass the value to the textbox in the second example [http://scratchpad.50webs.com/frames], as it says "src1" after the "?" question mark in the URL of results.htm,

so if a put a text box like in example 1 [http://scratchpad.50webs.com/iframe], the textbox would display the textbox value with "src1"..

here is the javascript file, for the second example:
http://scratchpad.50webs.com/frames/search.js

how can I display only ONE <iframe>, and also display the "passed" textbox value (as in http://scratchpad.50webs.com/iframe), in the results.htm page?

I tried editing the js file by trial and error, but no use.. help!

thanks

yoshi555
01-14-2007, 04:33 AM
If you just want to have a google search on ur site? Then they give you the codes:
<!-- Search Google -->
<center>
<FORM method=GET action="http://www.google.com/search">
<input type=hidden name=ie value=UTF-8>
<input type=hidden name=oe value=UTF-8>
<TABLE bgcolor="#FFFFFF"><tr><td>
<A HREF="http://www.google.com/">
<IMG SRC="http://www.google.com/logos/Logo_40wht.gif"
border="0" ALT="Google" align="absmiddle"></A>
<INPUT TYPE=text name=q size=20 maxlength=999 value="download opera">
<INPUT type=submit name=btnG VALUE="Google Search">
</td></tr></TABLE>
</FORM>
</center>

VatsaL
01-14-2007, 09:14 AM
If you just want to have a google search on ur site? Then they give you the codes:
<!-- Search Google -->
<center>
<FORM method=GET action="http://www.google.com/search">
...
<INPUT TYPE=text name=q size=20 maxlength=999 value="download opera">
<INPUT type=submit name=btnG VALUE="Google Search">
</td></tr></TABLE>
</FORM>
</center>

hey thanks for replyin, but I really need to work with an <iframe> !!

to be more precise again,

Taking into consideration the example at http://scratchpad.50webs.com/iframe/index.htm (http://scratchpad.50webs.com/iframe),

If I enter a word "water" in the textbox on http://scratchpad.50webs.com/iframe/index.htm (http://scratchpad.50webs.com/iframe/index.htm),

the word "water" would be displayed in the textbox on the next page (http://scratchpad.50webs.com/iframe/results.htm (http://scratchpad.50webs.com/iframe/index.htm)),

and the google search results for "water" in an <iframe> also on the results.htm page (http://scratchpad.50webs.com/iframe/results.htm (http://scratchpad.50webs.com/iframe/results.htm))

Passing the form text to the next page is already working, I just need to work on the <iframe>

How do I get the iframe on the results.htm page to display the google search in an <iframe> for a word that was entered in the index.htm page?

thanks a lot.

yoshi555
01-14-2007, 05:14 PM
I dont no but if this will help i no how o make a thing where you vlick on the link and instead of the link opening inside the the same window, tad, or diffrent window it opens inside an iframe next to the links?

VatsaL
01-14-2007, 05:52 PM
I dont no but if this will help i no how o make a thing where you vlick on the link and instead of the link opening inside the the same window, tad, or diffrent window it opens inside an iframe next to the links?

thanks, iframe on the same page is kinda easy, I can manage that.

real problem arises, when I dip into a situation like now, n can't find the easy road.

thanks, anyways.