0

I am writing a code to do a google search. i am actually appending the string to the end of the google search string

<body>
  <form name="f" action="http://www.google.lk/search?" target="name3">
    <input  name="name1" type="hidden" value="">
  </form>
  <center>
  <iframe name="name2" width="100" height="300" src="somePage.html" target="name3"></iframe>
  <iframe name="name3" width="100" height="300"></iframe>
  </center>
</body>

This code works, but it displays 10 search results, what i want to do is to display only 5 search results. So the google search string to do that is;

http://www.google.lk/search?q=THESEARCHSTRING&num=5&

So what i have to do is, to append the search string which is "THESEARCHSTRING" in between http://www.google.lk/search? and &num=5&

How do i code this ?

help appreciated ?

2
Contributors
5
Replies
6
Views
6 Years
Discussion Span
Last Post by diafol
0
<form name="f" action="http://www.google.lk/search?" target="name3">
    <input  name="name1" type="hidden" value="">
    <input type="hidden" id="num" name="num" value="5" />
  </form>
0
<form name="f" action="http://www.google.lk/search?" target="name3">
    <input  name="name1" type="hidden" value="">
    <input type="hidden" id="num" name="num" value="5" />
  </form>

I am using iframes here, so how do i fix it to an Iframe ?

0

You don't seem to have an input box for search term nor a submit button. I assumed you were dealing with ajax of some description. How do all your iframes work? I'm a little confused. Where's the php?

//Anyway, I have never tried the num parameter before. I gave it a go, but it doesn't seem to work. How about you? I set num to all kinds of different numbers, but I just get the same old results (everything).

Edited by diafol: n/a

0
</head>
<body>
<form>

<input type="text" name="query"  >

					  
<input type="button" id="mysubmit" value="Search ">
</form>
</body>
</html>

This is the file that is in the somePage.html (this is in a IFRAME). and once the SEARCH button is clicked it would show the result in the other IFRAME.

I need to restrict the search to 5 items, and not 10 which is the default

Edited by localp: n/a

0

Your Sri Lankan designation works well - doesn't work with co.uk or com. :(

<form name="f" action="http://www.google.lk/search?" target="name3">
    <input type="text" id="q" name="q" />
    <input type="hidden" id="num" name="num" value="5" />
    <input type="submit" value="go" />
</form>

Works for me (haven't tried the iframe stuff though).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.