3 Replies - 7038 Views - Last Post: 03 November 2009 - 02:26 PM

#1 IngeniousHax   User is offline

  • |>|20-514<|{3|2

Reputation: 84
  • View blog
  • Posts: 1,385
  • Joined: 28-March 09

custom button and google search

Posted 02 November 2009 - 05:09 PM

So me and an acquaintance are looking at throwing up a search engine that uses googles' search, however, we were curious can you use a cutsom button to do a google search? Not too sure about this as I am not a web developer of any kind, but I imagine you could just place a code behind the button to use google search right?

If so, could some links or anything be thrown out at me to look over?
Is This A Good Question/Topic? 0
  • +

Replies To: custom button and google search

#2 athlon32   User is offline

  • D.I.C Regular
  • member icon

Reputation: 117
  • View blog
  • Posts: 363
  • Joined: 20-August 08

Re: custom button and google search

Posted 02 November 2009 - 05:50 PM

well, technically the button doesn't perform the search, the form does. the button is a launcher so to speak :D

is this what you had in mind?
<form action="http://www.google.com/search" name="searchbox" 
  method="get" style="margin-left: 2em;" /> 
  <input type="hidden" name="hl" value="en" /> 
  <input type="hidden" name="ie" value="ISO-8859-1" /> 

  <input maxlength="256" size="40" name="q" value="" /> 
  <input type="submit" value="find it" name="btnG" 
    style="font-size:75%;" /> 
</form>


that will perform a google search, and you can add lines to make it speacial. for example:

 <input type="hidden" name="sitesearch" value="dreamincode.net" /> 


the line above makes it search only dreamincode.net from google :D

Also, Google offer a custom search service, which can be found here :)
http://www.google.com/cse/?v

hope i helped :D

P.S. by custom button did you mean custom visually? or as in custom to make it search google?

This post has been edited by iphoneorange: 02 November 2009 - 06:12 PM

Was This Post Helpful? 0
  • +
  • -

#3 IngeniousHax   User is offline

  • |>|20-514<|{3|2

Reputation: 84
  • View blog
  • Posts: 1,385
  • Joined: 28-March 09

Re: custom button and google search

Posted 02 November 2009 - 10:17 PM

Yeah, I meant visually. But is there also a way to center a button underneath the search bar (a custom button).

So in other words, you would have to take the script and inject it into the button and than center it underneath the search bar, right? or no?

And if i'm wrong, please correct me as I have no idea on what to do.

Also, that script you gave out, does it just do a google search from a search button...?
Was This Post Helpful? 0
  • +
  • -

#4 tharam04   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 13
  • Joined: 27-February 09

Re: custom button and google search

Posted 03 November 2009 - 02:26 PM

View PostIngeniousHax, on 2 Nov, 2009 - 11:17 PM, said:

Yeah, I meant visually. But is there also a way to center a button underneath the search bar (a custom button).


Yes. You can put the form within a paragraph and then have the search box above the search button like so
<p style="text-align: center;">
<input type="text" name="search" /><br />
<input type="submit" value="Search" />
</p>




View PostIngeniousHax, on 2 Nov, 2009 - 11:17 PM, said:

So in other words, you would have to take the script and inject it into the button and than center it underneath the search bar, right? or no?

And if i'm wrong, please correct me as I have no idea on what to do.

Also, that script you gave out, does it just do a google search from a search button...?

No. The script goes into the form command. If you wanted, you could have the search criteria box one one side of the page and the submit button on the other side of the page :D although I wouldn't recommend that.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1