![]() |
How can I add a Google search box to my Web site?
Dave, I keep visiting sites and seeing these cool search boxes that let you either search their entire site or search the entire Google database, all without leaving that page! I want to have something like this and would appreciate your helping me figure out the code needed.
This is a question that's going to result in some HTML listings. You know that, so there's no reason to panic! First off, the good news. Google itself actually has a nice page offering you HTML code you can just cut and paste onto your own Web pages to produce the search box you seek, and some variants beside. Just check out Google Free. Instead of relying on the bright sparks at Google, though, let's go through the steps of building our own search box instead, so you'll be able to see how it works. Also, not to pick on Google because I think the world of those folk, but their HTML samples could be cleaned up a bit, usually, so I've also recast it as proper XHTML rather than somewhat sloppy HTML. Just don't tell Larry and Sergey, okay? The basic technique involved here is to be able to manipulate one of the variables handed to the Google search engine, a variable called sitesearch. Set it to a null value and you're searching the entire World Wide Web, but set it to a specific domain and it's constrained exactly as if you had typed in the Google special notation site:domain. In addition to that, you need an input field and a submit button. Put them all together and here's the minimalist Google search form that lets the user alternate between just your site (well, in this case just my site) or the entire Web: <form method="get" action="http://www.google.com/search"> <input type="text" name="q" size="31" maxlength="255" value="" /> <input type="submit" value="Google Search" /> <input type="radio" name="sitesearch" value="" /> The Web <input type="radio" name="sitesearch" value="askdavetaylor.com" checked /> Ask Dave Taylor<br /> </form>There are some additional tweaks we can apply to make it a bit more fancy, including changing the radio buttons to a single check box, and aligning things a bit more nicely using a table and some simple CSS: <form method="get" action="http://www.google.com/search"> <div style="border:1px solid black;padding:4px;width:20em;"> <table border="0" cellpadding="0"> <tr><td> <input type="text" name="q" size="25" maxlength="255" value="" /> <input type="submit" value="Google Search" /></td></tr> <tr><td align="center" style="font-size:75%"> <input type="checkbox" name="sitesearch" value="askdavetaylor.com" checked /> only search Ask Dave Taylor<br /> </td></tr></table> </div> </form>Here's how that renders when included on an HTML page: If you'd like to use this on your own site, simply change the occurrences of askdavetaylor.com as appropriate. Not too hard at all!
Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Stumble Upon
Categorized:
CGI Scripts and Web Site Programming
(Article 3802)
Tagged: Previous: Selling jewelry on eBay, does it need to be appraised? Next: Should students use Google for research? View Mobile Version Subscribe!
I tried this and when I try to enter a search term it sends me to the google page. Any thoughts on what I may be doing wrong or not doing. If it's working properly, the search box should send you to the Google site, but with the word or words you typed in prefilled in as the search terms. Is this not what you're seeing? If so, what are you seeing? Also, what happens when you type in a term on the search box at the end of my article? Does that work for you? Posted by: Dave Taylor at December 11, 2004 4:23 AMIs there a way to have the results pop-up in a new window? Posted by: John Kiester at December 11, 2004 4:51 PMJohn, you'll laugh when you find out how easy that is! The line <form method="get" action="http://www.google.com/search"> just needs to have target="new" added and it'll redirect the result of that form to a new window called "new". If you always want to guarantee that a new window is launched rather than possibly reusing the 'new' window, use "_blank" as the target instead: <form method="get" action="http://www.google.com/search" target="_blank"> Hope that helps! Posted by: Dave Taylor at December 11, 2004 5:07 PMI looked at my coding several times last night and missed a typo. Things are working just fine now. Thanks for your help. Posted by: PJ at December 11, 2004 5:10 PMOK...I must be missing something here. How does this code search MY site? For example, if I have the word "pumpkin" on a page in my site will this search return a URL to that page? Posted by: David at December 13, 2004 1:39 AMThanks for your note, David. Checking on "search my site" in the form causes the search to automatically include "site:yourdomain" so that it only searches pages in the Google database that have your domain as the base of the URL. In essence, it's a search engine for your site alone. Matches then go back to your site. Hope that clears things up! Posted by: Dave Taylor at December 13, 2004 1:51 AMDave, now I understand what it is supposed to do. I thought it was going to search in MY domain...within my site...for the text entered...my bad. Thanks for setting me straight. David. Posted by: David at December 13, 2004 10:31 PMI would like a search box to find things within my site only. my site is not ready yet to submit to any of the search engines as i dont want to get black listed for broken links etc. How can I make and test a search box for my site without submitting to Google etc. Cheers Posted by: adam at January 20, 2005 8:49 AMYou can't use the Google search tool to find content on your site if you don't want Google to see it, Adam, so you'll need to install a search engine of your own on your server. If that's a possibility, then I'd talk with your Web hosting provider because they might already have something installed. Good luck! Posted by: Dave Taylor at January 21, 2005 2:41 PMThank you for this tip! How kind of you to do all this work so I can have it so easy. THANK YOU THANK YOU THANK YOU! Posted by: Donna at June 3, 2005 4:14 AMI'm making my site and have kept the google search in it. It's too easy to put google search and in few seconds it worked fine. Thanks alot for the code that is mentioned here. I've added my site to google and would like to know more about how I can get my site on the index page of google. Regards, Dave,I have added Google to my webpage using the "Google free" code. Can you please tell me how can i by default place the cursor in google search box? Posted by: Vikesh Jain at July 29, 2005 12:15 PMIt is my understanding that you can get paid by Google when people use your site's Google search box. How does that work? Do the ads have to be able to pop up on your site or can the inquiries be sent to the Google website, leaving our website free of clutter? How do you set it up so that we get paid when people use our search box? I have tried to find the answer in Google's help pages but I just can't seem to get a solid answer anywhere. We are also trying to customize the appearance of our Google search box so that it fits within a certain space designated on our website. Any recommendations? I am at my wits end and desperate for help! Posted by: Tracy at August 5, 2005 8:51 PMI'm trying to add the Google search to my blog, but it doesn't seem to work. Perhaps I'm inserting it in the wrong location. Perhaps I need different code because it's a blog, not a web site. Any help would be appreciated. The blog's purpose is to facilitate communication among former high school classmates, many of whom do not seem to be very Internet savvy. I'm hoping a "search this site" function will help them to locate names more easily Posted by: Nadine at August 18, 2005 11:07 PMhow can i make a search "form" such as one that a car dealer would use to have people search his site for a car. one that would use multiple boxes such as "make", "model", "color" etc. and use all the boxes to come up with results Posted by: manny at August 19, 2005 8:45 AMHi Dave, I entered the code like said and changed the domain, but the search won't work on my site. (as in, won't return a search relevant to my site), but will do the google search just fine (when i uncheck the box). any thoughts on how i can fix this? thanks! Posted by: Jillian at August 27, 2005 5:58 AMTwo issues, Jillian. First off, you need to not send the "http://" part in your 'sitesearch' field, but more importantly, a search of Google shows that it doesn't have a single page of your site in its search engine, so there's no way for it to ever succeed. Try searching for 'site:www.askdavetaylor.com', for example, then search for 'site;vespa-rosso.blogspot.com' and you'll see what I mean. Sorry! Posted by: Dave Taylor at August 27, 2005 6:37 AMDave, I'll fix the first part (the http), but I also noticed the google search thing. How can I change this? I listed my site with google about a week or two ago. Thanks! You might just need to have some patience, Jillian. Google has a "sandbox" where brand new sites and domains are parked for a few weeks up to a few months before they're added to the full Google database. That's so spam sites don't just pop up and corrupt / pollute the Google database, but it's darn frustrating for us legitimate content providers. Sorry! Posted by: Dave Taylor at August 28, 2005 4:11 AMHi Dave, I've read all your comments to other posts and I'm using CityMax for my host and they don't offer a search box for my site. I'd love to have one that just searches my site and no advertisements.. google seems to have a problem with my site since it's through a host and not mine... :(Can you help me with how to add a search box to my site that only returns items from my site with pictures? Like any one of the pages listed below would be fantastic. Thanks and praying really hard for help :) Deborah Posted by: Deborah Skipper at September 3, 2005 9:38 PMHi Dave, I ve got the google search on one of my sites and it works great for searhced throughout that site. any ideas? Posted by: chris at October 11, 2005 8:41 PMi have a set of pages to be listed and another set which should not be listed.. how do i do this? Posted by: Balaji at October 12, 2005 11:57 AMBalaji, you'll want to learn more about the robots.txt file, and specifically the equivalent meta tag you can add to specific pages that tell search engines not to include those pages in indices. See: http://www.askdavetaylor.com/about_robots.html Posted by: Dave Taylor at October 12, 2005 6:36 PMHi Dave, I was reading your article about the Google Search Box. I have a website running in PHP-Nuke. The code does not seem to work. I tried adding it to a block, and all that appears is just the *.gif from Google. Can you help? Posted by: DJ Ortiz at October 16, 2005 5:57 PMOk I see that you have ads by google on the top..well I signed up for google ad sense..and when I copied and pasted the html code to a site..the ad on there was for another site. Isn't it supposed to show my site ad? Could you help me out on how to advertize my site? Posted by: Youx at November 2, 2005 2:01 AMYoux, I don't really understand what your expectations of AdSense are: you don't want ads for your own site on AdSense, because then you'd be paying for click-thrus that are from people already at your site. Make sense? Posted by: Dave Taylor at November 2, 2005 4:05 AMI got a search box coding from your site. Thanks a lot for it. Thanks a lot. Posted by: Vidya at November 20, 2005 10:51 PMI was wondering if there is any way to add a 'Local' search box to my web site. I would like to have a link to search local restaurants, stores, etc... Is there any weay to do this? Thanks! Posted by: Danny at November 29, 2005 6:54 PMI was wondering if you can stop the google search from looking in certail folders/directories? Thanks for all the help? Posted by: cw at December 5, 2005 10:19 PMThank you for all you do for us. Yes, check out the robots.txt information on the Google site: http://www.google.com/webmasters/bot.html I think that'll show you how to exclude certain directories. Posted by: Dave Taylor at December 7, 2005 7:28 AMcan i include in my site to search web sites from my site or i need to pay any thing? it is opening search result in the same web brouser cant we open in the new web brouser? Posted by: Sajja Rjaes at December 26, 2005 11:36 PMSajja, you're welcome to use this code for free - thanks for asking - and if you want to have it open in a new browser, add target="_blank" to the "form" tag. Posted by: Dave Taylor at December 27, 2005 11:09 AMI put a google free site search on my webpage and there is another one below that with search the web and my website. I look in the HTML code but there isn't any for the bottom one. I only copied the HTML for the top one. How do I remove the bottom one? Posted by: Peder at January 7, 2006 4:33 PMPeder, assuming you haven't copied and pasted it twice, I can't imagine how the code I present here could produce two search boxes for you. Can you email me your page URL (use the "Ask" button near the top) and I'll have a quick peek? Posted by: Dave Taylor at January 8, 2006 12:02 PMHow do I add in the option of searching either the Web or only pages from the UK Posted by: John at January 19, 2006 10:37 AMJohn, just tweak the code I show to have the option of adding site:uk as a way to constrain your search results. Posted by: Dave Taylor at January 19, 2006 10:44 AMthanks for the quick reply. Not knowing how to do HMTL code you couldnt give me a clue how to restrict the search. John Dear Dave, is there any way to have the results of the search display in my own page rather than googles? if not, do you know of a search engine that can be bought that has functions to prioritize search results? let me add my thanks to the bunch. thanks. george Posted by: george at January 24, 2006 3:51 PMA couple of questions: And is there any way of tracking what people are searching for, when they use the search box on your site? Any ideas of how you can do this? Posted by: Trudes at February 8, 2006 12:36 PMGeorge, Trudes, no, you can't do that without some sneaky hacking behind the scenes that Google won't look upon happily. In terms of what they're searching for, yes, you could theoretically create a search box that feeds the search query to an intermediate script that logs their search pattern then bounces them directly to Google. Hmmm.... :-) Posted by: Dave Taylor at February 8, 2006 2:45 PMOk, now you've lost me. How would I set up an intermediate script? I'm still learning! Posted by: Trudes at February 9, 2006 5:26 PMhow can i add vote button to my website. When you use google as a search engine on your own site, I think you still need to display the Google graphic. (See Section 2.3 Attribution at http://www.google.com/services/terms_free.html ). Please correct me if I'm wrong. Posted by: Anjanette at February 17, 2006 5:34 PMI've been looking for some proper valid code for these pesky search boxes all day. At last I've found it! Thanks Dave! And (if it isn't too late) Happy New Year :) Posted by: Chris at March 2, 2006 8:23 AMHello, recently I decided to add a search feature to a site I'm constructing, http://skee.zaiph.net Thanks in advance! Also, if this helps any, the link to the Google searchbar is at ~James Posted by: James at March 12, 2006 9:16 PMJames, the reason that Google isn't finding your search results is because your site is just too new. Your best bet for getting into the Google database is simply to have sites point to you and make sure that each of your pages points to all your other pages. Then just have some patience! Posted by: Dave Taylor at March 12, 2006 10:18 PMHello Dave, Dear Dave, Excellent information! I'm using the Google search (not for my site, just to do full web searches from my site). How can I get the cursor to default to the Google input box? I'm glad to send you a link to my site, but didn't want to post it as it's under construction, and currently lacking in some areas of security. Thanks for any help or suggestions! -Steve Posted by: Steve at March 24, 2006 6:27 PMI would like to have the Google search box search several different sites (call them "a" "b" & "c") all at the same. So far I can only get it to either search the whole web or just one site. I can do this with Yahoo but can't figure out how to do it with the Google code. any ideas? Posted by: Cecilia at March 25, 2006 9:21 AMSteve, that's a basic JavaScript trick: make sure that the input field has an explicit name (which it should anyway, let's call it "fieldname" for this explanation) and that the form itself has a name (add a name="formname" attribute within the FORM tag itself), then in the BODY tag add the following attribute: onLoad="'document.formname.fieldname.focus();" that should be all you need to do! Posted by: Dave Taylor at March 27, 2006 8:54 AMHi, How would be the same search box using froogle? javier, please see: http://www.askdavetaylor.com/how_can_i_add_a_froogle_search_box_to_my_site.html Posted by: Dave Taylor at April 4, 2006 9:42 AMYour code and this page are not XHTML valid. I believe the checked value is the problem. Posted by: Castor at April 15, 2006 4:41 PMFirst, many thanks for the great information! Can you please explain how to use the site: variable to search several different sites at the same time? I would like to have a search box on my intranet that searches a handful of sites, but I don’t want to offer each site as a choice, I just want a box and the Google search button, and have it search all of the sites. Thanks in advance for your help. Dave, how can you change the attributes of the Submit button (font, color, color of the button, etc.)? When I get the answer, I promise to buy you that chai. Posted by: Mae at May 4, 2006 6:38 PMMae, good incentive! Here's what I wrote up: http://www.askdavetaylor.com/how_do_i_change_the_appearance_of_a_submit_button.html :-) Posted by: Dave Taylor at May 5, 2006 11:48 AMThanks Dave! You're the best. It's hard for my readers to search my old blog postings but you've just made it easy and nice to look at! Posted by: Fashion Victim at May 7, 2006 5:52 AMI would like to have the google search and google adsence to my website can you guide me how to do it. If i copy-paste the the code you mention above where will the box be placed on my webpage , will it not change all the existing setting. Posted by: Mukul at May 14, 2006 4:24 AMTo get started with AdSense, Mukul, please check out the following quite popular reference page: http://www.askdavetaylor.com/how_do_i_get_started_making_money_with_google_adsense.html Hope that helps you out! Posted by: Dave Taylor at May 15, 2006 10:08 PMUsing the "google search" seems reltively easy as you explained! It seems the only search I get is from my index (home) page? What is the proper code to search all pages? I'm the novice here when it comes to html and my site is as "green" as can get for expertise! Thanks so much and I do enjoy all the reading! You're very knowledgable and appreciated! Jeff Posted by: Jeff at May 20, 2006 8:46 AMplease give some idea to develop a searc engine. Thanks a lot for the code, but I couldn't get it to search an internal database on an internal network (my code for database search was as value="K:\InternalDatabase\" (drive and file names changed for security reasons, yet the format is exactly how I have it)). Do you know if I can make the database searchable with Google Search? Posted by: Vitali at June 14, 2006 8:16 AMI would love a search box for my site however, I don't like the way it is boxed with a black line. Miriam, that's easy. Just take out the border:1px solid black; from the code snippet (it's in the "div" tag) making sure not to remove the quote just before it, and you'll have the box and search function without the black box line! Posted by: Dave Taylor at June 19, 2006 9:51 AMI was wondering, I want to put this google bar in my banner on my page, but I am building it in Fireworks and there is no code view, can I do this? I also will be using either Dreamweaver or FrontPage, could I put it in my banner using one of these programs? I would use the banner as a background image except I have my buttons on it so I am going to have to import it as multiple Fireworks files. Help would be great! Thanks! Posted by: Matt at June 28, 2006 10:48 AMI added the Google site search to my site last year. But it does not find new content. For example, I added the terms "yankee doodle dandy" to a test page back on 9/9/2005. However, upon a "site" search, it does not locate the page with that term. Can I assume that my site must be re-indexed by Google before any new content will be found? thanks in advance Posted by: nick at July 6, 2006 9:59 AMI've trie to put google search on my site in the top border (front page) so it will appear on each page, but I cut and pasted it, couldn't find the html for the border. Help......Nice site!!! Posted by: Bill Randle at July 14, 2006 2:08 PMhi dude....i ur site is very useful for me....here i come up eiyh one question... i need to add my website in google search... i need the simple steps in designing , implemetation & i also want to know about aother pay search engines... it will be very help full for me if u do this Hi Dave - This should be easy for you, but I'll still buy you a Chai if you can help... I just put an Adsense search box on my front page, but I'd really like the button to default checked on MY site. What do I have to modify in the code? Thank you so much. Posted by: Steve at August 8, 2006 10:55 AM...And while I'm asking, I just noticed that on my OS X system, When I used the search box with "web" clicked, it turns up nothing in the search! But it's just fine on my older system. What am I doing wrong...? Thanks again. Posted by: Steve at August 8, 2006 12:02 PMSteve, the AdSense search box is a different beast. Let me dig around and see what I can put together. Posted by: Dave Taylor at August 8, 2006 3:34 PMI'm grateful for websites like this, and I'm very thankful for people like you, dave. Thank you very much. But I'm wondering if, for example, somebody did a search for my website and did not find it, but my other website can be found, how can I add the new website to appear in the search? Posted by: nephi at August 22, 2006 2:58 AMDave, I can't get either of your above sets of search code to work. What could I be doing wrong. Thanks , Jerry Posted by: Jerry Mersch at September 1, 2006 5:34 PMI can't get Google Search box to work on my intranet site. Can it work on an intranet site? Posted by: Terri at September 15, 2006 7:03 AMhello dave,actually i am kind of new to adsense and web designing.I have a blog at http://technogeekzz.blogspot.com/ at blogger.com.Now I am truly amazed by this site! Why are you doing this? WHEN are you doing this? - Anyway, I very much like the 'additional tweaks' version of the script on top of this page. Can you also do it the other way round? I mean, what is the code to create a decent search box and submit button just to search your own site and a little check box underneath if you want to search all of Google? Thanks. You can most definitely tweak things. Have a look at how I integrated the AdSense for Search system into my Intuitive Life blog, actually: http://www.intuitive.com/blog/ (it's on the right nav bar, about half-way down the page) Then read this to see how it was done: http://www.askdavetaylor.com/how_can_i_get_google_search_results_on_my_site.html Posted by: Dave Taylor at September 29, 2006 10:21 AMI added your google search tags to my webpage, which didn't pass XHTML validation. To be sure, I pasted your tags on an empty page, but it still earned one error as below. Please help! +++++++++++++ value="askdavetaylor.com" checked /> only search Ask Dave Taylor "VI delimiter" is a technical term for the equal sign. This error message means that the name of an attribute and the equal sign cannot be omitted when specifying an attribute. A common cause for this error message is the use of "Attribute Minimization" in document types where it is not allowed, in XHTML for instance. How to fix: For attributes such as compact, checked or selected, do not write e.g <option selected ... but rather <option selected="selected" ... Easily fixed to be fully XHTML compliant: value="askdavetaylor.com" checked="checked" /> that's all there is to it. Posted by: Dave Taylor at October 7, 2006 12:46 PMHi Dave, Thanks, Mike Posted by: Mike at October 7, 2006 5:23 PMHello Dave, Thank you for answering my earlier question. Your answer helped me understand the validation error message! Posted by: Yoki at October 13, 2006 2:19 PMHi Dave - I'm using frontpage to design my site and am having some problems with the search box. I copied the code you gave me onto my site and it doesn't seem to return any results. I understand that it won't return anything results from my site yet since I just registered with Google, but shouldn't it return results for searches outside of my site? Right now, when I click the button, nothing happens. Help - and thanks for all the good advice. Posted by: Keith at October 29, 2006 6:21 PMNice article, i have a simple question, is it legal to edit the google search form ,remove the google image and radio? i would like to do that on my site www.BadrIT.com. Posted by: Mohamed Hassan at November 6, 2006 10:41 AMMohamed, I guess it depends on how you define "legal". There's no *law* saying you can't do that, and I really can't imagine that Google is going to notice or really care if you tweak with the script if you're sending them traffic. However, I do recall that the terms of service for searches indicates you shouldn't be monkeying with the script. Posted by: Dave Taylor at November 6, 2006 3:35 PMThanks for your reply, i reviewed the terms of service but the only restriction i could found is that i must put google logo, can you tell me please where is the part that say not to play with the scripts, i am feeling that i may missed some thing!
First thanks for all the helpful information. I imported the code and when I search "my" site, for a word, for example, Necklaces, it returns results from my shopping cart software, but not from my site proper. When do a Google site search for www.maggies107.com, I get the first page of my site, and the shopping cart data. What do I need to do to get the balance of my website to show up? Would including the sitemap for the Google information cure this? Thanks for the info. Appreciate the service, as I am in the boonies with no other brains to pick. Posted by: Margaret at November 17, 2006 2:18 PMThis page requires Unicode support of your browser. You need "Arial Unicode MS" font to properly access this page. If you see any junk characters, square boxes or question mark, it shows that you do not have unicode font installed on your machine. Microsoft Office 2000 or higher version comes with this font. You can install this font from the Office CD. You may try to download particular language font from Thanks for the code. Great help!!! Posted by: George Elliott at December 8, 2006 3:18 AMHi Dave! Wicked awesome plugin. But, I do have a query. First: It works. No sweat. Dave, Thanks for the code to add google search box in my blog. But i have a problem integrating wikipedia search within the same script.. i tried making another button for wikipedia but with no success with the search results. Since i am not that familiar with HTML, i couldn make it work. Is there any way u can make it work? Dear Mr.Dave, When I add your code into my blogger:
"Please correct the error below, and submit your template again. Please help me to solve this problem. Thanks you so much. Thi. Posted by: Thi-AIT at January 26, 2007 12:56 AMMy server has a pre-coded search query box that searches just my site and does what I need for the most part. I am satisified with that aspect, yet is there a code I can insert within their code that will HIGHLIGHT the search result? I have an example for test search box on the url: http://www.puddleofmuddfanpage.com/upchurch.htm A search of 'Chicago' yields 13 results, but I have a lot of text on the site and I feel the users will get frustrated trying to find their keyword without a highlight tag. Or another option, is there a code that will make it jump to the first result within the website, then a next button, similar to the search option for a keyword in Microsoft Word Document that will make it jump right to the next result? FrontPage has an insert search box option, but I have a code conflict with my server and I'd rather just use the servers code and I insert their code manually. My site is new and hasn't been listing on Google yet so the Google search box isn't an option yet. Thanks for all your assistance to others, I have been reading a lot of your site today. It was really fruitful and it was up to my needs it also proved to be inspiration for me i tried and found out Google Custom Search Engine Ultimately very happy.... Posted by: Chaitanya Parekh at February 12, 2007 6:55 AMThanks Chaitanya Parekh ! With a little work I finally got it to search all of my pages and not just the front page. Also for the ease of use for my visitors, I just added a message above the search box to view in 'cached' for their keywords to be highlighted since I have a lot of text on my pages. I appreciate your suggestion for to Google Custom Search Engine option. Up and running perfectly, thanks again. Posted by: Karen at February 12, 2007 4:04 PMHow do you make a "Submit" button automatically pop up? Posted by: Eric at February 21, 2007 11:43 AMHi I just wanted to say thanks for the code, I am currently having a problem getting the code to search my whole site though, here is my form,
If you could get back to me that would be most appreciated. Wayne Posted by: wayne at February 23, 2007 1:16 PMWayne, that is the problem I had in the beginning, trying to get it to searc all of my pages. With more reading into the how to section, I found I had to add under the control panel/sites, some wildcard entries to have it hit all of my pages. Fill in your site name and add each URL: *.puddleofmuddfanpage.* I have those 3 listed and it searches all of my pages. So it appears you should have a minimum of those 3 versions. It works with no problems, I added it to my front page in the left column if you want to take a look. Also if you type in a keyword, such as Chicago, if you view it in cached option, it highlights it to make finding the keyword easier. I have a lot of text on my pages, so I added those directions above the search box so users would be able to find what they are looking for easily. Hope this helps! www.puddleofmuddfanpage.com
Wayne, is it possible that your site simply isn't fully indexed by Google? Try doing a search like site:askdavetaylor.com (with your domain name rather than mine) and see how many pages match. That's an easy way to see what's in the index... Posted by: Dave Taylor at February 27, 2007 9:19 AMHi Mr.Dave thanks a lot for the great codes. what does script error 95 mean plz help it keeps coming up on mii piczo site i wanna no how to deletye it cause i can not edit anything plz help ..... thankz for the help .... xx dana Posted by: dana toppinen at February 28, 2007 6:36 PMre: Kontera and multiple web pages If a person has a website with many many pages, what is the easiest method or manner to insert Kontera code on to each of those webpages? Thanks... Colleen Posted by: Colleen at March 3, 2007 5:45 PMColleen, I hope that you have some sort of template or other system built around a content management system (a blog, something like Article Manager, whatever) so that you can apply changes quickly? Failing that, some server-side includes (SSI) that lets you change one file and deliver up the changes to all of your pages? Otherwise, well, you have a tedious task ahead of you.. Posted by: Dave Taylor at March 3, 2007 8:45 PMHi Dave I would like to add google search to my companies intranet homepage to search the internet, do you know how to do this using xml? Our intranet home page was built using flex2. Posted by: jon at March 6, 2007 7:54 AMThanks works a treat Posted by: Damian at March 6, 2007 9:19 AMHi Dave, This code is great, thanks. One question though: Is it possible to have only the text input field and submit button and it still search only our website, not the world wide web? I have no use for the radio buttons or the check box.. Posted by: Cain at March 7, 2007 11:36 PMNevermind! I used a hidden input type with our site address as the value and the "sitesearch" as the name and it works fine. :D Posted by: Cain at March 8, 2007 12:26 AMHi,Dave. Note: The google have sent me the key code, even though,i cant search what i want exactly. I have a major problem i add google search box in my site but it only search for few static page of my site not for whole site .please tell why it is happening Posted by: naveed at March 8, 2007 1:38 PMThanks Dave. I'm using your code on my site and it works great. Posted by: Dave at March 8, 2007 7:57 PMDave, dave, there are some of the strange google search box, like there is a backround int he search box, how can we do that ? l mean a backround image in search box and a default text "search in google" or some special features, can u teach us pls ? Posted by: recep at March 22, 2007 4:30 PMDave, I was just wondering how do I take out the ads from google search? it's working fine but I don't want to have ads displayed on the University developed web site. any suggesions? comments? Thanks in advance, Regards, Dave, Now if I could just find some people who want to buy wooden pens, bowls or keychains ... Oh well, Adsense won't pay the mortgage on my house yet, but it's almost to the point of paying for the website rent. Progress ... not perfection. Posted by: BillinDetroit at April 6, 2007 10:41 PMHi i have the box on my web page but you can not search in in what do i do here? Posted by: Tom at April 11, 2007 4:41 AMHie I have a search option. In which there is a textfield and Submit Button. Before i press the button, i have two Radio Buttons. I want to have a check that when 2nd radio button is pressed it should go to google for search. Otherwise it should search within the website. Can you help me implimetning these two? Help much appriciated. This web site is to search for words within the web site, so I would like to use my own search button like I've seen everywhere on other sites. I have seen the Google Search that gives you two options, to search thru Google or thru the web site itself, but when you chose to search thru the web site Google jumps in and the words you selected are listed with your web site link at an outside Google listing. I would like for people to type a word inside the search box and to jump straight to where that first word is and so forth. Is there an easy way to achieve this? I'm not technical at all and time is of the essence to get this set up for our members and everyone out there. We conduct paranormal research and educate the community in the paranormal field. I can even go as far as letting someone design my search button with that purpose and give him/her credit on the web site... This is an extension of a non-profit organization, Paranormal Awareness Society, Corp. and we need help. Please help me. Lourdes Metz Posted by: Lourdes Metz at April 20, 2007 8:40 PMThanks !!! its work !!!!!! Posted by: sami at April 21, 2007 9:44 PMhi every body Posted by: nijyar at April 25, 2007 6:19 AMThank goodness I found this answer I had done all sorts of searches and could not find code I wanted. Now the hard part. The code works fine. But is there a way to get the terms that people searched for from this form. That way I can learn better what they are looking for and tweak the content. This would be great! I am running on windows server and did not know if have to have database set up or could just get e-mail? Posted by: David Cox at April 25, 2007 2:57 PMIf you had access to your server, you could write a rudimentary CGI script that simply logged the search string and then bounced it to Google. That's probably a three line shell script in Linux, for example: #!/bin/sh exit 0 [caveat: not tested!] Posted by: Dave Taylor at April 25, 2007 3:40 PMI set up an Access database on my site, but not sure how to get form to also place info into it. I am using dsn Posted by: David Cox at April 25, 2007 7:02 PMJust dropping by to say thanks for the great and thorough information, as usual. You are obviously a very dedicated and hardworking individual. Posted by: Internet Marketing Tools at April 30, 2007 2:02 PMThanks Dave I will try this but I am not linux aware. Posted by: David Cox at May 1, 2007 4:55 AMku soo dhawoow website ka maxamuud, does this google search tool work on a password protected site? or does that mess things up since the site is not available to all? thanks! d. Posted by: daurie at May 10, 2007 11:13 AMHey Dave, I just wanted to know if theres was any way that I can take out the padding on the search box? I want to put it in between my columns but I want it to fit snug tight without padding on top or bottom? Is that posssible? Posted by: Guitar man at May 17, 2007 9:15 AMYou bet. Simply change that first DIV to remove the "padding" parameter: <div style="border:1px solid black;width:20em;"> You can also tweak the width to fit your constraints too, including using a pixel count instead (e.g. "width:100px;") Posted by: Dave Taylor at May 17, 2007 12:17 PMThanks Dave! It worked great! You are definitely a gentleman and a scholar. Thank you for all your help, Have good one! Posted by: Guitar Man at May 18, 2007 10:00 AMDave: I tried your example and it worked like a charm. The question I have is there a way to convert the results to an iframe without the google search bar showing up? Thanks! Posted by: mike at May 21, 2007 3:19 PMHi Dave For example, I added the terms "yankee doodle dandy" to a test pagee recently, However, upon a "site" search, it does not locate the page with that term. Can I assume that my site must be re-indexed by Google before any new content will be found? " if so please suggest some simpler and faster indexing method as my website content changes frequently. Dave, Great site for those of us starting a website for the first time. My question: When someone does a google search from my site, can I have it first open a new tab if using tab browsing and if they don't have tabbed browsing, then open a new page? Much Appreciated. Posted by: Greg Smith at May 28, 2007 9:20 AMBadshah, you need to wait until the Google spider sees your new pages. One way for that to happen more quickly is to frequently update your site with new content, which teaches it to visit you more often. Greg, yes, you can do that. Add "target="_blank" within the FORM tag and you'll find that the search results pop up in a new window. Posted by: Dave Taylor at May 29, 2007 12:07 PMhow can i search in my website by using google search Posted by: osama at June 4, 2007 4:36 AMthanks dave for the reply, i am not exactly getting your point that site should be updated daily, does it mean i need to add pages to website or just update/change the contents of the pages/pages already present?, now in either case whatever your reply is like adding pages/changing page content , if i do it on daily basis , does that mean google will eventully index my site daily as my site is should change almost daily and customers should see changes on daily basis too , waiting for ur Hi dave, am having problems in locating html of my site, how do i go about it. Thanks Hello Dave.. I'd like to have 2 buttons instead of a google button and a checkbox.. how can I do this without the 2nd button having the full URL as it's face (value). In other words.. I would like the button face to say "LI Online" instead of www.longislandonline.com Posted by: Peter Armenti at June 27, 2007 7:16 PMWhen I click on a location from Google's search, a different website shows up. It says "jump" and then loads a website i didn't click. Posted by: fred s. hobbs at June 30, 2007 2:13 PMhey. this is so cool. super. thank you very much for this info. cool cool cool! :D Posted by: mastermind at July 11, 2007 9:59 PMLike Fred recently queried when I click on a location from Google's search, a different website shows up. It says "jump" and then loads a website i didn't click. Posted by: Lou at July 12, 2007 5:14 PMHi Dave this is great thank you very much. Just wondered if you get could the search result to open a new window or tab (same as Greg Smith at May 28, 2007 9:20 AM). Posted by: Martin LS at July 15, 2007 4:28 PMMartin, as I said earlier in this stream of comments, yes, you can do that. Add "target="_blank" within the FORM tag and you'll find that the search results pop up in a new window. :-) Posted by: Dave Taylor at July 15, 2007 8:58 PMdo you know how I can make the google search box search a mysql database? Posted by: Jeff Stevens at July 16, 2007 10:18 AMWe, as HornAfrik webmasters, are glad to join to the Google host page, please help us to find the easest way we can our website in an automatically? So that, how can we deal with this matter? Wish you the best. Posted by: mmguuleed at July 18, 2007 3:07 AMHow can I make this search box code, have google search two or three sites, instead of one? thanks, Kenneth Posted by: Kenneth at July 19, 2007 1:22 PMHi, Thanks a lot for the feature, but how can I add a Google Image search? Thanks, Tom Posted by: Tom S at July 21, 2007 5:52 AMThanks Alot Dave ..... May God Bless U Posted by: Broken Pixels at July 31, 2007 10:03 PMhow do i not give the user the option to search google.com, only my site? Posted by: lolman at August 5, 2007 3:50 AMHow can I create a sign up box on my web site? All I want is to collect the name and email address of visitors who wish to participate. You Rock Dave!!!!!!!!!!!!! Tanx a lot, I have a cool Search Box now on my site www.sajadghaffoor.blogspot.com tanx 2 you!keep up da good work Posted by: Sajad Ghaffoor at August 15, 2007 11:26 PMDeve Great job, Hi Dave, Many thanks for this, it's helped alot! Cheers Do I need Google's permision to add google search on my site? Posted by: Kawaljit Nagi at August 21, 2007 8:30 AMDear contributor, copies the codes from this site and pasted it straight into a blank document under the body tag...unfortunately it was displaing the code i pasted under the preview.....PLS HELP ME OUT Posted by: mujeeb at August 23, 2007 1:05 PMMy web site is www.ppc4you.blogspot.com. I cannot make my site on the google search even though i have submit my site into the google site map Posted by: PPC4YOU at August 23, 2007 8:59 PMJust wanted to point out that the checked/selected attributes as used here are not actually XHTML compliant, as they are not well-formed. A well-formed attribute is in the form selected="selected". Posted by: matt at August 25, 2007 11:31 PMAbsolutely true. It's been a constant frustration that the code offered up by sites like Google and Amazon are often sloppy and need to be cleaned up to be standards compliant. Y'd think they could do better... :-) Posted by: Dave Taylor at August 27, 2007 10:34 AMThanks hello u nailed my qustion right! Hi Dave, Thanks ALOT....I was looking for that... How does one use a graphic as the input button/ submit button? I'd rather not have the Submit button but a gif instead. Posted by: Bryan A. at October 2, 2007 6:46 PMThank you so much for this awesome code!! Unfortunately, I am using this within a company intranet and when I click the search button, it tries to load in our intranet url and causes an error. It will not open in the web. I tried changing the code to open in a new window and it doesn't make a difference, our company url is still at the beginning of the address. Can you help (hope this makes sense)? Posted by: Amy at October 5, 2007 3:57 PMHi Dave, I'm making a page and on the top left is the name of the site and I want the search box on the top right. I've tried doing it but it then doesn't work because its outside the red box. How do I also move the red box so that the search box appears top right? Posted by: Sean James Cameron at November 3, 2007 6:49 AMHow do I make a comment box like yours? I am adding a google search and want an new window with a fixed width (say 600px wide)w ith the search results to open over the top of the website. How do I do that? Thank you so much for your help! Posted by: Janine at November 20, 2007 3:16 PMWhen I run the search on my own site, I get results, great. But when I go to those pages, I get the text, but the images don't show. Any idea why? I added your search to a page in my help file, which I created in FrontPage (that has a sucky search feature), and my help file is hosted on a google-registered site. Posted by: Victoria at November 21, 2007 11:38 AMThanks this code, i shall add this to my limo hire site shortly Posted by: leo r. at November 28, 2007 2:24 PMWe want to add our pages in googlr pages because please guide to us. Posted by: Discover Nepal Exports at December 4, 2007 6:55 AMThank you, Dave Taylor for this website of yours. Humbly, a shy devotee Posted by: Lesley Critton at December 4, 2007 10:11 AMThank you Dave Taylor...For days I'm searching for this code. Finally you gave it..!! Thank you. Posted by: Saheer.N at December 9, 2007 11:33 AMDave, I've followed your instructions. However, the search term(s) do not transfer to the Search Page. I do get redirected to the search page, but then have to retype the serach terms. I am using my own search engine and NOT Google. Is the code different? Posted by: Tom at December 10, 2007 3:40 AMTom, undoubtedly your search engine doesn't work the same way that Google does. Most importantly, you need to do a search and then look at the URL your search engine uses to identify the *name of the search term variable*. With Google, it's "q", and that's what this script produces too. If your system uses, say, "searchterm", then just tweak my script to use that variable name instead. Posted by: Dave Taylor at December 10, 2007 12:00 PMHi Dave, thanks for your code. I fairly new in this field and sometimes when i am stuck it takes for ever to figure it out. I have added a search to my site and changed the stle of it with some css, but it just won't work properly. i am looking up things that I know are in teh site, but it doesn't find them. Can you help? Posted by: Lorinda at December 14, 2007 8:16 AMDave, I have been pouring over this code and I can't seem to figure out why my search box won't fill the google search textbox when I click on the button. Do I have to use a submit button? Right now I am using an image for my button and I think that may be what it has to be. I am using IE7 and when I copy and paste your code it still doesn't work. They only difference in my code is the CSS id's, etc. That won't affect the functionality of the form. What am I doing wrong? Posted by: Brandon at December 20, 2007 12:46 AMHi Dave, i need to display the search result in my website itslef. Can you help me? Dave, Hi Dave. Maybe I've missed this somewhere, but how do I get the search to only look at one directory in my domain? I'm looking for it to only search files in my help file, but not to look in the rest of the site. I'm unsuccessful. I looked at that bot thing, and i didn't see an answer. So, for example, it currently looks at www.mywebsite.com, but I want it to look at www.mywebsite.com/directoryA Is there a way to do that? Entering that path simply returns o results. Thanks Posted by: Victoria at January 3, 2008 4:11 PMVictoria, I've pulled your question into its own posting: http://www.askdavetaylor.com/how_to_google_site_search_look_constrain_subdirectory.html Hopefully that'll help you out! Posted by: Dave Taylor at January 4, 2008 8:25 AMHi Dave. Thanks for this information, I have the google engine on my website ( www.mytravelicious.com) now. Just have a question- how do I put it on the center? Many thanks Posted by: Grace at January 8, 2008 9:36 PMHi,thanks alot for ur help. Regards, Dishon. Posted by: Dishon at January 13, 2008 8:09 AMThanks Dave, you've saved me!!! Your site is one of my favorites now :) Posted by: Elsa at January 14, 2008 11:56 PMI placed your google search on two of my web sites and they are great. Finditmall.com and citizenhealthwatch.com Posted by: Joe Holmes at January 17, 2008 10:21 PM Dave, My website's html layouts are fine in IE but in firefox there are some layout issues. Can you please tell me how i can validate my website's html according to firefox and IE. The perfect solution which u recommend. Posted by: Mutahar at January 29, 2008 12:44 PMdave, you seem to be telling alot of people who ask about opening a search in a new TAB, the "_blank" html code, which is to open up a new window... is there one for opening a new TAB. I can't seem to find a code anywhere, and a client has requested I incorporate this kind of feature in their site search. Posted by: cally at January 29, 2008 9:47 PMAs far as I can tell, Cally, there *is* no way to actually have a target= value that opens up a new tab; that's up to the browser software and indeed there are browsers that don't support tabs (for example, cell phone browsers). Further, the entire target attribute is deprecated in the XHTML standard, so we should theoretically have stopped using it anyways... Posted by: Dave Taylor at January 29, 2008 11:37 PMHi dave, I need some advise regarding adding google adds on to my website. I have given my URL above, and i got all the codes from Google and pasted on my website, but the adds doesnt seem to appear on my page, I managed to get the google search box on to my site. please help me with this. Regards Posted by: Fawzer Faiz at February 2, 2008 10:54 PMBrilliant!!!! Hi Dave, recently my Google image search button has stopped working. If I click the button leaving the query blank I get the Google image search page, but if I search for a picture it returns the regular Google results page, not the image results. It worked for months. Do you know what happened? Posted by: Robert at February 10, 2008 8:51 PMHey Dave, For example: They type in "pit bull" and it actually searches for "dogs pit bull". Posted by: Alex at February 11, 2008 5:25 PMHi Dave, Can you make the search result pop up in another window, like this HTML code for a link: target="_blank" Posted by: jack at February 15, 2008 3:53 PMJack, yes you can do just that by adding that attribute to the FORM tag. So instead of having something like FORM METHOD="get" ACTION="xxx" you have FORM METHOD="get" ACTION="xxx" TARGET="_blank" Posted by: Dave Taylor at February 15, 2008 10:53 PM
value="askdavetaylor.com" checked /> only search Ask Dave Taylor
hello Dave, I have added your search code in my web page but it wont work fine. My web pages are in sub folder like "abc.com/xyz" Can u help me Posted by: nikhil at February 22, 2008 9:28 AMHello Dave, First of all great site, so much informatio. I already use google search through my adesnse account and was wondering if it is possible to add my adsense code or to your code above or somehow tweak my google search box to look like the one you have made? basicllay so i still get to use my google adesnse serch but have a different look. Thank you for your time. Posted by: Tom at February 23, 2008 9:27 AMDave, I just wanted to say thanks. I have a site that's heavy with original content, and I've never been very good at archiving. It is absolutely AWESOME to have this tool for my readers. You're the best!! Posted by: JGolden at February 26, 2008 8:30 PMHi dave, thanks for your work, i have succesfully entered google search into my web page.But how can i make it an external link, i don't want it to open in the same window with my page. I have also tried for several times to add my site into google but it's now about 4 months and it's not yet posted what could be the problem and what can i do? Thanks for the nice tutorial. I searched it for 3 days before comming to this post. You made my day... how do you have it only show the search bar and no dial? Posted by: pyrofool at March 4, 2008 8:59 PMDave, I have a new website that I bought that came with and without flash. I using the with out flash site, it much eaiser to use in Front Page. Any way my question is this. On the contact page I have a box for the person name and email that they can type in as well as a message with a submit button. How do I make this work when they click the submit botton. Do I need to add something to the code? I know how to make e-mail links and what not, but I'm not sure what to do on this. Any help is much appreciated. Posted by: Ronnie Rokk at March 6, 2008 4:52 PMhallu dave! thnks for ur great tips! anyway, i am trying to create / design my own site using microsoft frontpage application which i plan to publish using free server ( for testing of course ). Therefore, i hope you could help me to include google ads + google search box into my site which i created using frontage application? thanks ya! Posted by: lady at March 9, 2008 8:15 AMThanks! best help ive ever had! Posted by: Sam Shannon at March 20, 2008 1:33 PMHi. l just finished making one with google before l found yours . can l delete the google one and use your code. it looks cool Posted by: tina at March 20, 2008 5:04 PMThanks, Dave! This really works! Posted by: IdeaSmith at March 21, 2008 9:05 AMDave, I love these pages. Make more pages!!!! Dave, I am designing a site for a friend who is an artist. She wants visitors to be able to search for images and be taken directly to that image. e.g. say she has a painting of a frog or frogs, if someone enters frog in a search box she wants all the frog paintings to show up. Is this possible? Preferably for free? Or am I asking too much. Hi Dave, I'm a Realtor in Arizona and in the process of creating my 'website' and it is quite a challenge to me. How do I add the google search so it goes to my webpage? Hi Dave, is there any way to have the search function without the check box? so that it automatically searches your site first? The Box and text is taking up a lot of space and I'd like leave them out! :-) Thanks much! Posted by: Andres at March 26, 2008 12:28 PMhow can I get this to work for google images dave? Hello Dave, Exactly what I needed, thanks a lot for sharing your knowledge. :) Posted by: Jack at March 30, 2008 4:38 PMHi Dave. I must say you are doing a great job on this site. Thank the Heavens for people like you. I'm designing a Web directory and would like to find out if you are allowed to put a Google search box in your site without Google's permission. In the design I have already created the search box using the code I found on this site and I have also inserted the Google logo. Do I have to get Google's permission? Thanks. Posted by: Wong Xulu at April 3, 2008 9:19 AMthanks you Posted by: PREFABRIK at April 3, 2008 1:44 PMthanks a lot. its good comment. Posted by: arti ajans at April 4, 2008 1:41 PMThanks, This is great Posted by: Simon Shaw at April 7, 2008 4:13 PMCan this be added to invision message boards? Is there any search that can be? Hi, Can u please tell me how can i make this form, running inside an asp.net form ? Thx, Just say a lot of thanks for this nice tutorial! Posted by: fxekobudi at April 18, 2008 4:21 AMHi Dave, Dave, I've cut and pasted your code for the Google Search and it works great, however, in the frame of the search box "maxlength 255 value=""/>" is listed. Also, at the bottom it also says "value=divine9online.com checked /> only search divine9online.co" Shouldn't that text be hidden in HTML view? Please advize. Thanks Posted by: Mike at April 23, 2008 10:58 PMMike, I think your problem is that when you cut and pasted, you ended up getting some extra carriage returns in your results. The lines that you're seeing and don't expect to see, make 'em part of the previous line and you should be good! Posted by: Dave Taylor at April 23, 2008 11:06 PMThanks for giving such a useful information. I have used your code on my webpage. It is looking really nice. Thanks Posted by: Y4Yawar at April 29, 2008 4:43 AMHow can i put current new from major web like google news, yahoo news, other etc which changes automatically with new change on the support web. I want to display news as html web links not by RSS. I have a question about the Google search box. I set it up and it works, but it doesnt seem to seach a new directory that I put in the location. it searches all the other directories under the top level, but not the most recent one I placed there. This has been the case for four weeks now. Any ideas? thanks Tom Posted by: Tom Melkonian at May 2, 2008 6:22 PMHi, I am developing a site and I want users to enter keywords and look for similar pages on my own site. I mean the search should be restricted to my site only and I should show the listing alike google does. Does google help us in such requirements? Thanks in advance. Posted by: Imran Rahi at May 15, 2008 7:01 AMHow can i add a google search in my web (www.illusion.novoya.com) Posted by: Yuda at May 17, 2008 5:31 AMThis must be some kind of joke. What are you doing coming up with 'solutions' using inaccessible tables and deprecated rubbish like target="_new"???? Ever heard of CSS and XHTML Dave? Bring your coding skills up to date, man! Posted by: jb at May 19, 2008 5:54 AMHi, I am trying to build a family history site, but wish to keep living peoples information in password protected pages for security. Seriff web plus 9 does not do this, but they have suggested using a third party html code do you have any such codes or do you know where i could find them? Posted by: Debbie at May 19, 2008 2:34 PMjb, of course I've heard of CSS and XHTML. Heck, I wrote a book about 'em. If you go back and read the code I present, it's certainly XHTML compliant. In terms of using "deprecated" elements like 'target', I find that the newer ways of accomplishing these sort of capabilities are so clunky and awkward, that I view it as typical committee-speak goofiness and ignore that it was deprecated. Just because something is agreed upon by a committee doesn't mean it's an improvement! For example, it may be "wrong" to use something like <b> but if you don't want to learn CSS styles, "span", etc etc., it's sure darn easy for people to learn and remember. What's more important anyway, that it be "right" according to some committee, or that it be usable? Posted by: Dave Taylor at May 20, 2008 7:17 AMHi Dave, This is a great blog... thanks so much! I am trying to use the Google Custom Search tool (http://www.google.com/coop/cse/). The site I am doing this for (www.dawnnelson.org) is black, so I would like the results-page text to be white. However, I need the query text to be black, because the box background is white. I have looked through your blog post, but have not seen that topic discussed. Can you please explain the best way to do this? BTW, I had tried the AJAX version, but had the same problem with text color, so I reverted to the two-page version. Thanks, Hi there- Thanks so much for help with adding google search tool. Next...how to add a box or something where it says, Digg this and Stumble this, etc. Much appreciated! Can u please tell me how can i make this form, running inside an asp.net form. because if i put this form inside the main form which has a "runat=surver" tag then the search doesn't work but if i put it outside of the main form, it works fine. Please help me to solve this problem. Posted by: Abul at June 3, 2008 11:11 AMi've been trying to figure this out for weeks, as we say hereabouts, "Maraming Salamat, Dave!!" (many thanks, dave!!" Posted by: Manila Boy at June 4, 2008 6:33 AMthanks dave :) Posted by: yilmaz at June 10, 2008 4:51 AMSweet Post! Google search is also a pretty good way to monetize your site by directing users to search through your site daily and often click on advertised ads through your adsense account-earning you cashola! Posted by: Michael at June 20, 2008 3:21 PMHay, thanks for the script Dave, worked great, but like a few other comments have asked as well, is there any way to search google images by simply clicking on a check box or something before hitting submit? Thanks again Keep up the good work. I think by offering people the basics of coding then you don't scare them off, and therefore you give them the confidence to move forward and learn more. There's no doubting that you're an intelligent guy, but you also possess a natural aptitude for teaching. Hi Dave, You don't need google. The problem with google is that it index your site very randomly and not very often, so if you have a site which is very dynamic (i.e its contents change and new content is changed every now and then) then you need your own search tool as you want your users to get the latest results. The best that I have come across is Smart Spidey. It's the cheapest out there and works better than some of the most expensive search tool. It has a interesting Did you mean function and you can index your site anytime. Check it out at : http://www.smartspidey.com Posted by: Mikle at July 5, 2008 5:57 PMI HAVE TO ADD A GOOGLE SEARCH BOX ON MY SITE Posted by: george paily at July 12, 2008 4:38 AMI know this is a few years old but THANKS. Was trying to solve this problem - had been using an icky widget for the past several weeks and had to look at GET WIDGET beneath it as a tradeoff - but this does the same thing, simply and more elegantly. On behalf of all of us who are BIG on content and SMALL on coding ability, thank you!!!! Posted by: wsb at July 17, 2008 2:14 AMDave, I've been trying to add a google search box on my website, however, when I copy the code you provide into a page on my website it gives me an error that says Internet Explorer cannot display the page. I am using Dreamweaver and have the page setup in tables. If I copy the code into a blank page it works fine. What am I doing wrong? Posted by: Barry at July 21, 2008 11:21 AMI am in the process of revamping our website and was looking for "how to insert search button into website". I was very lucky to have stumbled upon this site! Thank you Dave, I used your code to insert a google search bar :) YOU ARE A LEGEND!!! Posted by: Suzie Tomkins at July 22, 2008 11:27 PMI Cannot Get The Code To Search My Site It Does Not Find Things but when i unclick the search my site only it searches for google only search ps3dexter.ca.tp
Hi... I am trying to add special search on my website. I need to search for special file, I am looking for a search box with radio buttons to choose what type of file you want to search. Thanks
hi i am currently developing in Visual web developer with a masterpage when i add the code and click on the search it just directs me back to my page...if i paste the code in the head of the content place holder it still does not work??i am pretty deperate for it to work Posted by: cheryl at August 4, 2008 6:48 AMI HAVE BLOGSPOT WEB SITE I NEED ADD , GOOGLE SERCHING BAR, ITRY 5-6 TIME STILL I CANT ADD PLS HELP ME Posted by: aAnura at August 16, 2008 10:48 AMHi, Dave, I think I read about that a long time ago and I have spent a lot of time today trying to figure out how to describe the HTML coding question. I like your site and I think you have already described this somewhere but could not find it. You can email me at my email address that I entered if you have the code for that. And...THANKS for all the good help you have given; others have acknowledged the helpful info that you provide. Signed -- Ralph Posted by: Ralph at August 21, 2008 4:24 AMI was looking for nice and attractive GOOGLE ADSENSE FOR SEARCH BOX. Is it legal to change the coding of ADSENSE FOR SEARCH?? Thanks Taylor. I'm using the code on my website and it works great. Posted by: petter at September 2, 2008 12:20 PMJust wanted to say that your table/CSS suggestion above worked AWESOMELY for me, and thank you so much for the simple tutorial. Posted by: K at September 3, 2008 12:10 PMwant to give the choice between images and web search and have managed to get image search by changing the first line to have been trying to make an option to search all of the web but the way that I have tryed just adds it onto the end of the action rather than replacing it any tips?? here is what i have been trying that dosnt work (input type="radio" name="sitesearch" value="" checked /) google image (/form) in the actual code have used pointy brackets but that made it go invisibal here ;) Posted by: noughtypixy at September 7, 2008 7:17 AMhello Dave, here is the problem i am having, i have implemented your search box on my web site, but it doesn't work. I think it is a form problem. Could you have a look on my web site and add some suggestions. I will appreciated greatly. Is there a way to have a search for just one folder, for part of the site? This part has gotten unwieldy and would like it searchable... branimear you need to move the FORM eliments inside the DIV tags then it will work Posted by: noughtypixy at September 15, 2008 11:37 AMI did that, now it work perfectly, thank you for answer. Will google be okay with me following this advice? Also, will adding a link from my site to google affect my page rank at all? Posted by: Jason Vandenbrink at September 17, 2008 4:07 PMhow do u make the google search for all pages within ur site because i want the google search tool to search pages of mine such as www.freecoursework.co.cc/dida.html, can you plz tell me how i can add more sites for the search results. Posted by: sadek at September 19, 2008 3:52 AMhow to add the my website togoogle search Posted by: surya at September 22, 2008 4:03 AMThanks a million! I had a good search box on my website once, but over time the code got messed up and it no longer worked. Also I think google changed their search box thing since then, so I can't make a new one (easily anyhow). This saved me! Thanks again, hope you don't mind that I modded it for my needs. Posted by: Fritz Lehman at September 23, 2008 8:44 PMdoes your site have to be on google search engine before you can use this search tool? Posted by: sadek at September 24, 2008 2:57 AMnice post. I will try... Posted by: Lyricist at September 26, 2008 4:04 AMHi David, Great topic. I have managed to get the code t work in a standard html page fine, however when I have added it to my CMS template...well nothing works :-( I have no idea why this is, have you had any history with the code snipet being inserted into immediacy CMS??? Thanks, Simon Posted by: Simon at September 26, 2008 9:47 AMNice! This beats having to set up php! Posted by: Matt at October 5, 2008 11:33 PMHi Dave, Thanks for everything Dave.... Posted by: Jim Ankan at October 8, 2008 11:30 AMThis is pretty awesome, I've been looking for this code for a while for my site http://theinternetbiz.com Posted by: cyndi whittley at October 13, 2008 8:51 PMHi Dave, It's useful, however, I'd prefer to have a searcher that doesn't have the Google looks at all. :S Posted by: Discount Travel Portal at October 22, 2008 2:25 AMThanks So much for the info- It helps me tremendously! Posted by: LN at October 27, 2008 8:42 PMHey Dave, This has been a massive help to me - been digging and thinking on this for months. My top tip to people would be to double check the scripting for typos when you amend it to your own website. Even though i copied and pasted, i still forgot to delete some bits when I added my own site details. it WILL and DOES work! If u have any probs, double check the script on your html page. Just was wondering how do you actually activate and use the google search? it seems like it you only to google's home page without submitting the query. how do i fix it? Posted by: Moustafa at November 11, 2008 5:12 AMPier, here's what you want: http://www.askdavetaylor.com/how_can_i_create_a_search_google_button_on_my_web_page.html :-) Posted by: Dave Taylor at November 12, 2008 9:40 AMSo happy that I found your site! Everytime I put Amazon in my search box [on my regular explorer page], it gets me to Amazon, then adds tons of letters to my search and it flips over to Google image search and cannot find what I'm looking for. Even though it just took me off the page that I wanted. This only seems to happen at sites where cookies are needed. I have done EVERYTHING suggested to enable cookies. I am on medium security as well. Why is google image search stuck on to my yahoo search bar? Help? Thank you in advance for understanding and helping. Posted by: moreyn kamenir at November 16, 2008 10:19 AMHi Dave, Being a bit slow, I wonder if you can help. Rather than having to load the Google Toolbar, is there a way I can simply replicate the Google search box on my intranet, ie Search the web with a check box option for the World or just the UK. Can you advise what code I need? Many Thanks. Regards, John Posted by: John at November 17, 2008 9:37 AMdo you know much about system development Thanks for your useful google search codes hopefully i will be able to add them to www.ziigames.co.uk www.jllmarketing.co.uk www.pembrokeshire-sports.co.uk soooon! Posted by: Zii at November 25, 2008 10:06 AMplease add this page if any body write azaan, quran naat on search bar. Dave, How do I add a search box & button as you have above that will search my site only, without having to have either the radio button or check box options? I just want to have the search box and button and nothing else.. thanks!! Posted by: Leee at December 2, 2008 10:24 AMHi, is there a way to search two domains? I want two sites searched only. Thanks Posted by: Mike at December 10, 2008 11:09 PMDear Sir, 5 month before i was join NIIT they assured me that they will expert me in web designing after 3 month they told me your course is complete & they didn't teach me & eat my money Rs 4000/- thousand & give me a certificate, still i am trying to learn web-designing online. i make a webpage in frontpage but i hv a few problem that is my webpage is working well in my computer if i check another computer so the webpage is not working well i mean resolution problem.let me know the some tips about webdesigning any one can help me. Posted by: Danish at December 13, 2008 5:40 AMHallu.. Love you all... Posted by: Nandy at December 16, 2008 5:07 AMThanks Dave...Your code worked on the first try.. thanks for sharing... Posted by: Asif at December 17, 2008 11:01 PMHi Dave, ive been trying to get my contacts page to send the information filled in the form to be sent to my email address, but to no avail. i have mae the form in html and it calls a php file that collects the data and posts it. i thought this would work but it aint. please assist me. Thanks in advance. can you add a comment box into freewebs? Thank you Dave, this article has helped me very well. I am searching for this type of help from long ago. I will definitely divert my friends to this article. Thanx again Posted by: ASIF SHAIKH at December 22, 2008 5:10 AMGreat job, thanks for explaining how it works. You can also change language of the search in Google by changing the'action="http://www.google.com/search" I needed Korean, so I changed it to 'action="http://www.google.co.kr/search" Thanks Hi, <input type="submit" value="search" /> how do i make this pop up to a new window? Posted by: Tamina at December 30, 2008 6:21 AMTamina, just add target="_blank" to the FORM element. Not the input element. Posted by: Dave Taylor at December 30, 2008 8:30 AMi have to add the search engine box in my web page. Posted by: suman at January 2, 2009 12:49 AMDave, I successfully added the Google site search box. I have an unpublished storefront of about 7 pages. How do I modify your code so the search will only search specific pages that I identify, ie. my storefront pages only. I know I must have the pages indexed by Google before the search will work. Each page is sequential and are named like so: storefront, storefront2, storefront3, etc. Will I need some wild card code or will I need to repeat each page. To clarify which code I'm speaking of I have pasted it below(it has my domain name inside). Thanks, Lon Search Site box <form method="get" action="http://www.google.com/search"> <div style="border:1px solid black;padding:4px;width:20em;"> Outdoor Photography Topic Gallery<br /> </form> add google to my site Posted by: weyons at January 11, 2009 9:11 AMThanks for this, i wasted a lot of time before coming here. very cool. Posted by: Michael Claymore at January 29, 2009 8:46 PMNice. I (and I'm pretty sure LOADS more people) really appreciate these simple, concise tutorials. Cheers mate. Posted by: Richard Sweeney at February 4, 2009 8:56 AMwhen i tick the box it makes no difference it still searches google Posted by: kyle at February 8, 2009 2:46 PMhello dave Hi Dave, Is it possible to display the google search results within a window on my website? Posted by: james at February 17, 2009 9:07 AMHi Dave, Awsome stuff. I was wondering how you get a comment box at the bottom of the site like this one. How would I go about putting that on my site? Posted by: Brett at February 17, 2009 10:03 AMthank u Dave! Its simple and it just works. Hi DAve, I added a Google search on my web site, but my site index page is made up with frames, so when the search is used the google search opens up in just that frame, how can I make it open on top please Posted by: Gordon Johnston at February 19, 2009 6:16 AMGordon, add target="_top" to the FORM tag and it should do what you want. In other words: <form method="get" action="http://www.google.com/search" target="_top" > That should do the trick! Posted by: Dave Taylor at February 19, 2009 6:37 AMhello, i'm new to google search, i did added the search box in my web site, when i key in some keywords there some can pop up result and some cannot, and these items are on the same web page, why this will happen? and also sometimes when i search an item that is let say on page 3 of my catalog, but the goole search result showing that is page 2, why?? Thanks for your tips..! Thank U Mr Dave taylor i hv successfully added Google search in my web page thanks , worked like a treat! Posted by: Ahmed at March 9, 2009 5:02 AMTHANX a lot..you made it easy to add google toolbar to my site.. Posted by: mrityunjay at March 14, 2009 6:21 AMHow can you list your website with Google? Posted by: Emir at March 16, 2009 6:43 AMHi Dave I can't access Google Apps because my domain host suddenly is no more. I am currently trying to find a new host for accommodationalbany.co.nz. In the meantime, because Google Apps only applies to existing sites, I went to Google Sites and set up what I thought was a web page, fairviewheightsbb@gmail.com. I cant find it on the web. I think there is another step involved to attract search engines. I am not familiar with HTML but does you advice about adding a google search box apply?. Do Google Sites attract search engines? Do I need a host? I need help for custom search engine html code that have by store, by brand & by category search button special for all my 70 online stores. Please help me! Posted by: Ab Razak at March 19, 2009 2:39 AMI got problem with my button. I already put the hyperlink but it seem unfunctional. Please give me a complete html code for button with hyperlink function. Posted by: Ab Razak at March 19, 2009 2:44 AMhow do i display the google search result in a same page? with the exact header and footer at my page.. Posted by: rahim at March 24, 2009 1:02 AMThank you brother Posted by: Karim at March 30, 2009 4:59 AMHi, Can anyone tell me if is possibile to make the search bar search in my password area? Like the protected pages? I tipe a name on that protected page but nothing:( So anywone ... Thanks in advanced ! Posted by: marius at April 11, 2009 4:34 PMplease tell me how to use the search box to search for more than 1 site at 1 time. Thank you Posted by: ray at April 17, 2009 1:43 PMDave can you guide me? Posted by: Mudassir Javed Khan at April 22, 2009 3:45 AMThank you, that was very clear and very helpful. Posted by: Mike S at April 25, 2009 4:58 PMDear Dave, Please help me understand what's wrong with my Google Search. Google offers three alternatives, two of which work properly and the third one (the one that I need) - does not work at all. 1. search results in new window on Google site - works I am using iWeb widget to create SearchBox and SearchResults area. Is it a problem of Apple's iWeb or is it a problem with Google code? Or am I a complete idiot? Posted by: Eugene at April 26, 2009 8:32 AMDave, Thanks for the solutions u've provided thus far.How do I add a search box to my website such that it conducts word search only within the website even when i'm not online. Posted by: quickcode at April 28, 2009 6:51 AMWhen I complete put the search box on my web site then the result show on new Google page and new out site my website theme. I want the search result show on my web site in ifram. please help me Posted by: sartopsm at May 10, 2009 5:44 AMwant 2 put add on googel.com Thank you Posted by: mojtaba at May 15, 2009 10:47 AMthanks a lot for your help. Posted by: vikalp at May 21, 2009 6:13 PMDude, WHY is question I made here not here?? Posted by: Phenom? at May 23, 2009 9:29 AMProbably because it wasn't relevant to the topic at hand, so I either moved it or deleted it. Trying to keep things coherent and logical. :-) Posted by: Dave Taylor at May 25, 2009 6:55 AM"Probably because it wasn't relevant to the topic at hand, so I either moved it or deleted it. Trying to keep things coherent and logical."
Now I would like to know if this is possible and if it is how it's done: make the first option search the web only and the second option search google images only. Without having two different search boXes.
Easy does it. I get a lot of comments and don't always recall why I do or don't moderate specific entries. Your question seems like a reasonable one and since the two use a very similar format, I expect it's doable too. For example, here's a search URL: http://www.google.com/search?q=my+search and the same search on Google images: http://images.google.com/images?q=my+search So all you'd need to do is change the "action" field of the form if someone indicated they wanted to search images, not the full Google search. Let me poke around, see if I can come up with the necessary Javascript... :-) Posted by: Dave Taylor at May 25, 2009 1:53 PMThanx a lotttttt how can i improve my website please help! Posted by: Danielle at June 2, 2009 3:18 AMdave, i tried your box but no search results came up. i just recently posted my site up. does this mean that the search engine hasn't crawled my site yet? thanks Posted by: david at June 3, 2009 10:33 AMDavid, sounds like Google hasn't indexed your site yet. The easy way to find out is to search for your domain name prefaced by "site:" (I'd use "site:askdavetaylor.com" for example) and see if there are any matches. Then compare the total number of matches (you can find that in the top right) to the number of pages you know comprises your Web site. Posted by: Dave Taylor at June 3, 2009 11:02 PMI want to add google search bar at my website. I have created my website (www.autoasia.net) using front page. When I paste the code of Google Search Bar wherein I want to put the Google Search Bar, only the codes are shown in design mode. No logos and no search bar is shown there. How can I do that, please advise SIR. Posted by: Reny at June 8, 2009 8:07 AMhey there dave! sir, Hey Dave- Thanks!! Posted by: Amy at June 20, 2009 2:54 AMVikas, the benefit to using Google as a search engine is that it does all the work for you and you don't have to worry about a site-specific search engine and maintaining it locally... Amy, you're right that if you are blocking Google from spidering your site by use of a robots.txt then this script will be useless to your visitors because it won't be able to search what you're not making available. You might check out http://www.lijit.com/ instead as a third-party blog search engine instead. Posted by: Dave Taylor at June 20, 2009 7:07 AMThanks a lot it is very useful God bless you. Posted by: Muhammad Ismail at June 21, 2009 9:43 PMThank you! It works alot and very useful for my homepage. ericard.webs.com Posted by: Ericard Production at June 22, 2009 10:41 PMHi dave. I am having a lot of difficulty with my website. I signed up with google adsense and i followed the steps. When I got to copying and pasting my html code they gave me, I get error on my page. I have tried created side bars and saving it and publishing it that way and I have been trying to add widgets and i copy my code but nothing. I am seeing ads by google on my site but no code. Its really werid and fustrating. I have been trying to do this for 2 weeks and been trying to get some online help and posting questions on the net. I am getting nowhere. Can you help me? Posted by: jennifer at June 24, 2009 6:07 PMThanks for the code - it works great - better than the standard google widget offering and I have started using it on my sites Freddy Posted by: freddy at June 27, 2009 11:25 AMthank you you just help me better working on my website. Posted by: rochelle at June 28, 2009 7:50 PMHi Dave, Thanks for the code, but can you tell me how place an image search button on the same page as a normal search button, I have tried myself but I can't seen to crack it. Thanks, Sam Posted by: Mr.Me at July 7, 2009 7:35 AMSam, not sure what you're asking. If you want *buttons* then you can easily have something pointing to images.google.com. If you want multiple search boxes, that's easy too, just make sure that you have each form (that produces the input area and button) end with the </form> tag: many web site builders seem to be predicated on you having no more than one form on a page. Posted by: Dave Taylor at July 7, 2009 8:20 AM"Let me poke around, see if I can come up with the necessary Javascript... :-)" Do you have anything? Posted by: Anonymous at July 15, 2009 5:43 AMHi Dave: Please don't post my website in your public response. I am trying to add a search function using lotus notes (not my choice). We have a document library that is an https site. Ideally we'd like the search engine to go there. When I write this code in lotus notes - it appears fine. But when I search either "the web" or internally, I get the following error: HTTP Web Server: Invalid URL Exception -- can you explain why? And honestly, more importantly, how I can fix/work around this? Thank you! Scott Posted by: Scott Herman at July 15, 2009 2:05 PMScott, I'm afraid I don't know enough about Lotus Notes to be able to assist. Seems like if you can create a search box on a blank page, though, you should be able to cut and paste that same code onto any page on your site. Good luck! Posted by: Dave Taylor at July 15, 2009 10:13 PMDave, in your reply to John Kiester, you said " just needs to have target="new" added and it'll redirect the result of that form to a new window called "new"". If you always...." My question, How you change the Google search box and it is violate the Google policies? Posted by: Mark at July 25, 2009 8:41 PMMark, we're not tweaking the search results window, we're just ensuring that it shows up in a separate window, rather than the same one. I really can't imagine Google caring (or even having any control over it). I'm sure it's not a terms of service problem. Posted by: Dave Taylor at July 26, 2009 12:03 AMI tried the free site search instructions on your url:http://www.askdavetaylor.com/how_can_i_add_a_google_search_box_to_my_web_site.html The first question to ask, Mary, is whether your site is in Google in the first place. If so, then try doing some searches like site:yourdomain.com test words (where "yourdomain.com" is your actual domain). Do they work? Do you get results? Then you should definitely be able to get the search box here to work. Posted by: Dave Taylor at August 4, 2009 5:09 PMI have just tried your search box and it works fine on my site. Just wondered what code I need to add, so as to center the entire box instead of it being on the left Posted by: Paul at August 7, 2009 10:50 PMMany thanks. Works perfectly. Posted by: Yolanda at September 2, 2009 10:25 AMI have seen the question asked many times but I haven't seen a response. Is ther any way to eliminate the advertisements in the results? Thanks Posted by: Jim at September 12, 2009 9:11 PMJim, why would you think that there was a way to avoid having the advertisements on the search results page? :-) Posted by: Dave Taylor at September 13, 2009 12:03 AMI just wanted to say thanks for the great tip on the HTML code for the Google Search Box. I could have figured it out but this made it much easier. Now I have it implemented on a custom start page for direct searches and to avoid their enlarged text and text box search page. Posted by: Ken at September 13, 2009 9:20 AMI found how to eliminate the advertisements. You need to pay $250.00 per year or more depending on your requirements. Posted by: Jim at September 15, 2009 8:54 AMDave, thanks for telling me how to add a search box to a website. Been wanting to add one to the Barradrum Farm (www.barradrumfarm.ie) website for ages. In my tests it is working perfectly, Thanks again, Tamar Posted by: Tamar at September 18, 2009 1:24 PMElias, I don't know how you would access the information someone has typed into their Google search bar, so I dunno how to do that. Posted by: Dave Taylor at September 22, 2009 6:34 AMThank you for a great script! Now, I would like an enhancement. Is there any way I can have the results of the search display within a page on my site? Posted by: Gail issen at September 23, 2009 1:47 AMThank you Dave! Posted by: Diana at September 24, 2009 9:50 AMthanks dave. you made my life easier. I have been looking for this for ages. Posted by: vijaykumapeta at September 26, 2009 11:02 AMThank you for the code to start a Google search. Worked on first try. Was using free Pico Search but they don't search pdf files unless you pay. Posted by: Ingo at September 28, 2009 4:04 PMHi Dave, perhaps you can help me - I have added a Google custom search box to my homepage, and redirected the results to a page called /searchresults.aspx. When I try the search, it goes to the right page, but doesn't show any text at all. If you are able to take a moment to look at the code, you will see the only difference there is to the code google issued me with is the "defer" command, which microsoft office live added itself. Thanks in advance! Posted by: Allana C at October 2, 2009 4:27 PMthanks dave. you made my life easier. I have been looking for this for ages. Posted by: bursa at October 4, 2009 5:41 AMDave, This is exactly, well almost exactly but close enough to what I was looking for. Excellent, clean, short nice. The only improvement I did was to move the "search" button to the right of the text box. Sometimes when suggestions pop up they cover the search button. Thanks for sharing this. John Posted by: Big John T at October 4, 2009 6:43 AMI added the google search box!SUCCESSFULLY..... THANK YOU SOO MUCH!!!!!!!!!! Posted by: satish at October 4, 2009 10:35 PMHave published the site now with the search box, thanks again Dave, Tamar (www.barradrumfarm.ie) Posted by: Tamar at October 5, 2009 6:45 AMHi Dave, Sry,another question... Thanks Dave 4 the article. I was wondering if i could redirect the output of search to some div in my webpage rather than making the whole page redirect to google. I need help on this. Thanks in advance Posted by: Jaivardhan Joshi at October 8, 2009 3:52 AMSry,another question... Have published the site now with the search box, thanks again Dave, Tamar (www.barradrumfarm.ie) Posted by: gaste bursa at October 9, 2009 3:21 AMHi Dave, I have managed to do some tweaking with javascript so as to enable muliple forms in a page, so as to enable the page to do some other postback also rather than just searching.
Where A1 is the link but my question remains...... can i redirect the google search to some div within my form Posted by: Jaivardhan Joshi at October 10, 2009 3:28 AMhi dave I found this very useful. Please email me after looking at the website and rate it. Speaking of rate you should show how to put a comment box or a 5 star rate system thanks alot Posted by: elric at October 10, 2009 3:58 PMhi dave, my doubt is how to link my hyperlinks to my google adsense search box and it should get the result page. Hi, Thanks Dave. Helped a lot!!! Posted by: Emmanuel Acquah at October 28, 2009 6:03 AMHi, Thanks for the help this is useful. Posted by: Andy at October 30, 2009 5:55 PMI want to add a radio tab along with others for image search, please help! Posted by: aakif at October 31, 2009 7:09 AMDear Dave, You are doing a great job for web professionals. I have one small doubt, please guide me. I have one website named www.logontowww.com . (1) In this site can i use the code shown below? [form method="get" area target="_blank" action="http://www.google.com/search"] [input type="text" name="q" size="31" (2) Is there any terms or rule violation for using this feature ? Posted by: G. Subhra Isaac Stein at November 2, 2009 11:10 AMDear Dave, only Research page of my site is in search results... why is this happens? All the best! Posted by: Andreja at November 5, 2009 6:51 AMi have tried it and it works very well. Posted by: Linda Smythers at November 19, 2009 5:22 AMya its very useful for me... thanks a lot... Posted by: CHILLAPPLE at November 19, 2009 8:41 AMDear Dave, Thanks. Posted by: Kevin Daniel at November 20, 2009 5:17 PMhow do i get a thumnale photo to showup on google Dave, you rock. Thanks for the quick and easy code, which works great! Posted by: Long Islander at December 4, 2009 9:23 PMWE CAN DO WHATEVER YOU WANT! Posted by: JOSE at December 5, 2009 9:04 PMsongs Posted by: husen at December 8, 2009 3:44 AMI'm still in the process of creating my site with Adobe Dreamweaver and I have the search bar on the site, but I cannot type in the search box when I preview the site or while I'm working on the site. I am extremely new to this and was wondering if I am doing something wrong. I know absolutely nothing about HTML and don't have the time to learn it by the time i need this site finished, which is in a couple weeks. Please Help ASAP. Thank You and God Bless, i want to submit my site on google search engine but unable any body can tell me about it please Posted by: Z R Abbasi at December 17, 2009 12:51 AMI am so glad that I found this website. I wish Google natively had a way to differentiate a site search or search the web with the radio buttons. Thank you so much for showing how to add the radio buttons!! Posted by: Mike at December 17, 2009 10:11 AMPlease help me to get more visitor . I have done my website before three or four month ago . I include google search tool box and best link search code. Yet I do not get visitor. my site is complete blog site . Education, Health , and photography tips with other... so please help me to get visitor.. Thanks... I'm so glad I found this site - I'm working on my gsce project at the moment and little items like this - which not only work first time but have also taught me about it and how to do (I've spent hours searching for a simple tutorial on a search bar!) will help me so much! hey Dave,'i have a free account with google sitesearch. is there anyway that i can put the results on a different page like u have it instead of having it pop up below? Posted by: justin at December 23, 2009 4:40 PMhow i add google on my site? Posted by: ZAFAR at December 26, 2009 7:49 AMHi Dave, Laneo, that's an interesting question: can you get Google search hints on a search box that is on your own site? I have never seen anyone accomplish this and have never really dug into how it's done on the Google home page, but my instinct is that no, you can't do it. Perhaps someone else can show otherwise? Posted by: Dave Taylor at December 30, 2009 8:12 AMHi. I just want to ask if there is a way to change the google search box just like in this link: http://educational-trafficandeverything.blogspot.com/ Pls reply thanks Posted by: Zal at December 31, 2009 6:51 AMZal, what am I missing? Just remove the border and drop the search button to below the input box and you have the same search box as that blogspot page? Or are you sneakily trying to get us to visit your blog? :-) Posted by: Dave Taylor at December 31, 2009 9:12 AMHi Dave, I am currently creating a website for my Uni semester on Notepad, and I want to add a Google search bar, the code is working fine on IE but when i load it in Firefox nothing displays. This is a problem because it needs to be user compatible. Is it right it just works on IE or have I dont something wrong? Posted by: sophie at January 2, 2010 2:32 PMHi Dave, This is a great article and it is very useful, thank you. I have a question, I would add the results in iframe without the google search box, can I do that? I just saw it in a blog and it is really nice, where our website header and footer still displayed and only google results displayed in the iframe. Thanks in advance for any help Hi Dave, I was trying so hard so far to find an answere to this but couldn't.. As you may see im and infant to web development and great if you can drop a line to this.
Many Thanks, Hi, I tried to implement the search code in my ASP.Net page that is .aspx page but it didn't worked. --I have put runat="server" with form tag as I am having some more controls on the same page for which I need to have runat="server" with form.I tried posting my code.But this site don't permit that. Please resolve my problem. Posted by: Khushboo at January 6, 2010 3:47 AMWorked like a charm. Thanks a lot for this excellent tip. Posted by: Steve at January 8, 2010 12:45 PMOk so i have put in the code and have added the code to my new site....which is still work in progress www.cheap3d.net problem is when i type something in there it takes me to google without a search result what am i doing wrong? Posted by: Sam at January 11, 2010 4:52 AMKhushboo, it shouldn't matter that your page is a .aspx page, as long as you can create a box of HTML that's not interpreted as ASP. I don't have a clue about that language, though, so I can't offer any suggestions. Sam, look for line breaks within your HTML and make sure that every line that has an open "" all on the same line. That should help! Posted by: Dave Taylor at January 11, 2010 6:50 PMHi Dave, Thanks for your reply. [form method="get" action="http://www.google.com/search" runat="server"] If I remove runat="server" from the form tag it works fine, but if I put that its stops working, please tell me is there any solution that this code should work with "runat="server" in form tag as well. Thanks.. Hi Dave, I thanks in advanced for helping all of us in fixing our websites. My question, I am using flash cs4 to build my website and i would like to know the code to add yahoo, google and MSN search box in my site. i want those 3 to have their own search box like the little one that comes in the regular website. thanks. Posted by: omar at January 12, 2010 7:46 AMThanks, i found what i forgot about this html code. Now it's clear. Posted by: leo at January 14, 2010 6:29 AMhello dave, i just want to know how to make a guestbook in classic asp which should work with form tag of html, which could able to put all the comments from form to ms access database Posted by: Mir Wais Nisar at January 15, 2010 7:04 AMI am searching for the same question that has been asked, and still I can't find the answer. That is not what he asked, he and I want to know how to put web search and your own site search. Sorry Dave, Thanks for this Dave. I have been coming to your site for ages and I never fail to learn something new. Posted by: Jenny from Find Someones Email at January 21, 2010 5:02 PMIts very disgusting to say that i don't know how to connect my website to the google searching engines.......................................... Posted by: Bobo Benson Kurgan at January 22, 2010 8:28 AMi have it set up but i wont work when i type a keyword in it says it has no results Posted by: conn at January 23, 2010 10:07 PMHi Dave, I tried to add the "Google search" into my HTML editor (front page), but the only thing that shows up is the HTML code on your site.. I may be adding it to the wrong place in my html...I am not quite sure where in my coding I would paste your code...It is very confusing...I could email you my home page in html, but I am not sure that would be helpful... Any suggestions where to cut and paste your html code?? Before tags? after tags? HELP???!!!! Bill Posted by: Bill at January 24, 2010 11:44 AMthis post has been so helpful, i always wanted to learn how to add google search box in my website and heres the answer, a magnificent post. thanks alot. Posted by: alan at January 26, 2010 4:03 PMthanks friend Posted by: niraj at January 27, 2010 11:00 PMI have spent so long trying to figure this one out my self. Thank you so much for making is easy. The code worked perfectly. Ray Posted by: Ray at February 7, 2010 8:46 PMI've successfully added Dave Taylor's "How can I add a Google search box to my Web site?" html script to my page. I'm wondering is it possible to do a google custom site search so it does my site and another... Usage Example: Option 1: Search "DELL AUSTRALIA" thanks friends for giving me google search engine code in html. Dave, THANKS for the great Google Search box! Problem is after the search is used or the page is The only way to bring it back it to hit refesh? I REALLY want this but my page disappears afterwards? Any Ideas? Thanks Again ! Posted by: michael wolf at February 10, 2010 7:35 AMHello Dave, thank you. Posted by: Dina at February 10, 2010 8:49 AMdave, thanks for the code.. was wondering if it can be tweeked to search 'this page only' where the item(s) being searched is/are highlighted on the page. thanks! Posted by: marc at February 16, 2010 9:39 AMwould you know how to make something like this but instead of searching add a comment to my myspace profile? like what i used to post this comment. ? i really want this! Posted by: James at February 19, 2010 4:35 AMHi Dave, I have acquired a Google page that opens with "test" in the search box and a full page of articles with "test" within them. I have tried to uninstall and even overinstall but now Google does not even appear in my list of programs. Alss, my AOL page is truncated and I can only read a portion of the e-mail description. This happened shortly before I installed Pareto File Cure and tried to install some of the "free" apps it said I needed. It was after this that I got the Google "test" search page. I installed SoftSpy and heretofore, as now, I use a WinSock XP fix which has worked well to keep me clean until now. Please help if you can. Thanks!! Rebecca Posted by: Rebecca at February 20, 2010 11:45 AMHi Dave, I really need your help in solving this problem. Google has always updated by website within 1 to 2 days of my making changes or adding content. The last date they crawled my website was February 13th. I made some changes on February 15th and now (no matter how many times I submit my url or use my submitter.net for submissions) no updating is occurring. It seems as though Yahoo and Bing have updated my website and Google has updated other pages in my website EXCEPT for the Home Page. What is happening? I am starting to be concerned. Alo, how do I get Google to use my description rather than other snippets they choose. Sometimes, they just list my categories in the left navigation. If you need my website address, please let me know. I thank you in advance for any help you can give me. Maggie -------------------------------------------------------------------------------- great site. great information this post helped me out alot. Thank you :) Posted by: budi at February 25, 2010 7:46 PMhnpwap free download Posted by: harsha prabath at February 25, 2010 10:50 PMI am a total rookie, I have not tested yet .. but thanks a lot just to start with .. Very Helpful... thanks! Posted by: Dustin at February 28, 2010 4:48 PMDave, I was able to place the google search function on my site however I seem to be having a problem. We need to search in Japanese. It seems that when I type in Japanese text and then hit "search" it defaults to ascii characters and not Japanese characters so the search fails. However, after the failure, if I *then* type in Japanese it works. If I type in English from the get-go it works. I need for it to work in Japanese from the first step and not after it errors-out. Any ideas on what is going on and how I can fix the problem? How can I add a Live Date & Time box to my Web site ? Posted by: Junaid at March 5, 2010 5:50 AMplease tell me about How i can google add in my site. Posted by: Jitendra kumar at March 9, 2010 9:33 AMHi Dave, I am creating a comparision site about lease and I am not sure how to get affiliated my websites to other leasing companies so that if someone clicks on their link i get paid and when someone signed up i get commission on it, is this something you can guide me about, please? thanks Posted by: Sid at March 9, 2010 3:26 PMI figured out how to search ONLY on my site without giving checkboxes or radio buttons for google, etc. Just remember to change your site where it says ENTERYOURWEBSITEHERE...
Thank you for the article... I was able to get the search to work, However when the results come up... it seems like the www is missing so when you click on the hyperlink that google returns it fails on load. Can someone tell me what I need to do to fix that ? This site is Https and I am not sure if the full url needs to show? or how to make google show it ? Posted by: Gina at March 24, 2010 7:49 AMI'm trying to create a mobile portal for myself, and changed the URL to the more PSP-friendly "http://www.google.com/m". Only, once I do that, the site-specific checkboxes stop working. Is there any way to get the checkboxes to work with the the mobile Google site? Posted by: Jasmin at March 24, 2010 12:16 PMAmazing! Thanks! Posted by: Wendy at March 24, 2010 1:23 PMhi this helped me to keep in my site so that visitors can search Hi Dave, Thanks for your info. I have used it to provide a site search facility on a site which I maintain. I was very pleased with your information, as implementing a version of your solution actually coincided with Google reindexing my site - I thought for a few minutes that you had wrought some magic, but sadly it was just a coincidence. Thanks again Dave. Joe Posted by: joe richardson at March 27, 2010 1:44 PMHi Dave, I wrote yesterday thanking you for the sitesearch code. On further testing, I am getting something strange happening. When I key the word "apricot" (without the quotes) into the search box in page http://www.stokesleypride.org.uk/html/search.shtml in Firefox I correctly get a single hit; when I do the same in Chrome the same happens; when I do the same in IE8 (8.0.6001.18702) I get "Your search - apricot - did not match any documents". I have cleared the cache in each browser, and the same occurs. I modified your code a little to remove the option of searching the web, and I should say that it is only yesterday that Google indexed the document which is the target of the search (a large word doc). I wonder if you have any ideas as to what I have done wrong? I wonder if I have produced bad XHTML which is being interpreted differently by the 3 browsers. When I do a w3c validate I get only warnings, but relating to the / at the end of the input tag. Regards, Joe Regards, Joe Posted by: joe richardson at March 28, 2010 2:23 AMthanks this is most important for me for add my site.
Hi, I used the same code. Hi, A Charity I am involved with has a link to a google search engine, http://google.hostuk.org/ John, looks like they're playing some games behind the scene and that they're using Google Search within an iframe or similar, something that lets them have standard AdSense ads on the very top line and the Google search results after. Note that there's no copyright or material at the bottom of their search results pages. My guess is that it's actually a violation of the Google Terms of Service, so I wouldn't be surprised if they were shut down at some point. Posted by: Dave Taylor at April 24, 2010 11:14 PMHello All, This is very intresting code... i dont wnt to go google page search result ..
Is there any way to make the results pop up in a hovering window like the Google Custom Search does? Also, I have tried searching my name, witch is on the home page multiple times, and it did not come up with anything. It also does not come up with the names of my pages. It is an HTML website; how can I fix these problems? Posted by: Jacob at April 29, 2010 3:41 PMOkay I foudn your website interesting Dave. But like many people have asked, how do I make a "search engine" that searches only my website liek the content of it and stuff like that? You said to people that they needed to install their own search engine? How do I do this? How do I make one? Could you send me links? help? Yes my site is blank, that is because im remaking one from my old one "http://www.ps3-clans.tk" because I prefer my new name. Plz respond A.S.A.P. please thanks Posted by: Montigny34 at April 29, 2010 4:37 PMThank you!!!! very much for this great clue am so delighted to having come in contact with this site. Again Thank you!!!!!!!! Posted by: Opara Prince at April 30, 2010 7:27 AMits really helpfull and fantastic' Wow. A lot of these questions are almost hostile! Thanks for the FREE advice on how to easily add a search function to a site. And for the FREE answers to many questions, that you seem to find time to answer....for free. Posted by: D.E.M. at May 2, 2010 10:27 AMDave, The search works great and thanks for the how to. I am wondering if you can tell me how to get the results to show up on a custom results page on my own site. Posted by: Nate at May 6, 2010 1:31 PMHi Dave, Is there a way to insert text into the search box as an example, "toronto red camera" but when the user clicks to put text in this would vanish so they can put in their own string without having to delete my example of how to search my site. Make any sense? and do you know if this is possible and I know its a long shot. Thanks again you rock! Posted by: Justin T at May 6, 2010 7:21 PMHere's the solution to my question above. <input type="text" name="q" size="25" maxlength="255" onfocus="this.value=''" type="text" value="example: toronto red camera" />
value="bridge.co.uk" checked I do not want the people to have a option if to have a check box or not, i want by default them to search my site with out showing a check box, can you help with a alternate code please. Posted by: hdelpihero at May 7, 2010 3:44 AMmy searchbox didnot work properly and this is not a first time. plz sir help me. Dear Dev, i was looking to place same thing on my website and very happy after this my website become a cool website for hang on by youth. thanks a lot Posted by: Baketi at May 14, 2010 1:06 AMDear Dave How can make to radio button one search in my site Regards. Posted by: The-Marshal at May 14, 2010 6:35 AMHi, I have followed the steps u hav mentioned above for adding a google search for my "website" on my server, The problem is my website also has the blog i'e www.xyz.com/blog (wordpress), 1. When I enter the keyword its successfully searching the wordpress database but not my website database or the words on my html page, Why so ???????? Thanks, hi dave, i am 14 yrs old and have made a web enabled software in asp.net. It works for post transaction recording facility of customers. Now the problem is that my clients have asked me to include a search box in the site and i am not able to figure out how to do it. can u please be kind enough to explain me the steps of adding the search box in a site developed in asp.net ??? I would be very grateful..
Dave, Hi, Hi Dave, I found your website, and it is really helpful for my school project. However, I would like to make the search textbox to be able to search three different websites e.g. Google, Yahoo, and Bing at the same time. Can I possibly do that? Thanks, actually i'm creating a website using frontpage. Hi Dave. actually i'm creating a website using frontpage. sir, I HAVE HCL WINDOWS7 LAPTOP,I WANT TO GOOGLE MY SEARCH ENGINE/HOME PAGE.WHEN I COME BACK TO SEARCH OR[AT FIRST SEACH TIME MY SCREEN ALWAYS KEEPS WHITE]PLEASE KEEP HERE GOOGLE SEARCH. Posted by: JEETANDER KUMAR at May 29, 2010 12:19 AMits really helpfull and fantastic' Thank you so much, worked marvels! Thanks Dave! This is pretty cool. Posted by: Eli at June 11, 2010 7:13 AMwhat is coding free web pages for intanets sites? I am trying to list a google blog on a vista print website and want a google adsense. Will this work or not? Thanks for the feedback. BreKay Posted by: brenda at June 11, 2010 12:20 PMThanks buddy for the code... thank you so much.. Posted by: Aman at June 17, 2010 10:10 AMHello Dave. How could I change the form below to the form for Google Search like yours? Please, I really need assistance with this. I have tried everything to get it just right, by going over your post 1,000 times. Yet, I keep failing. :'( <form action="#" method="post"> Well, it did not show the form. :'( Posted by: Bradley at June 19, 2010 10:53 PMThe code didn't work on my last post. But, your box is too big for the section on my website. How would I fix it to fit that area? Posted by: Bradley at June 19, 2010 11:00 PMHow do I get the search box to be in the centre of the page. What tags do i add to your code Posted by: DAVID at June 22, 2010 9:46 PMHi Dave, I like a few times above was curious as to moving the search box to the center or right. I am new to html coding and doing my own site for the first time thanks. Posted by: joe at June 25, 2010 2:25 PMHi Dave, I like a few times above was curious as to moving the search box to the center or right. I am new to html coding and doing my own site for the first time thanks. Posted by: منتديات at June 26, 2010 5:34 PMThere are a couple of ways you can move the search box, actually. first off, if you want to move the input field and button *inside* the box, then add <center> immediately after the <div> tag and </center> immediately before the </div> tag. If it's the entire box, then put the CENTER tags before the DIV and after the /DIV tags, respectively. That are more sophisticated ways to layout elements on a page, but I hope that'll get you folks started... Posted by: Dave Taylor at June 26, 2010 10:10 PMThanks for the tip and code. I added target="_blank" to so the search results will open in a new window. Posted by: CharlieB at June 27, 2010 11:24 AMHi thank you so much for all your work it is really helpful. [div id="checkbox"] the "/" in the value and "checked" don't validate... it's not a big issue but if there is a way around it that you know of I would really appreciate it. Thanks again Not sure about the value= issue -- haven't read the HTML spec recently -- but I can tell you that if you're using the /> notation as I am, you are using XHTML rather than HTML, so make sure that you have specified that in your document header and/or in the validator. Posted by: Dave Taylor at June 28, 2010 7:37 AMa way to make the code work with subdomain ? Posted by: nak at July 1, 2010 11:26 AMthanks dave now i add this in to my site. Posted by: salman at July 2, 2010 5:24 AMi luv u.....u solve my search problem for about 6 months now i have no problem for search in ma blog....bye and god bless u ...angel Posted by: deepak saini at July 3, 2010 7:17 PMcan make custom google search in my database.. Posted by: Ammar Alsulaimani at July 4, 2010 4:42 PMDave, Many, many thanks for this very clean search script. It works like a charm and I appreciate your efforts! Well done, great work! Posted by: Arjen at July 7, 2010 6:16 AMi luv u.....u solve my search problem for about 6 months now i have no problem for search in ma blog....bye and god bless u ...angel Posted by: اعلانات مبوبه at July 7, 2010 9:18 AMThanks this code works really well on my site. You've helped me solve a problem. Posted by: Geoff at July 11, 2010 8:52 AMGoing wayyyy back here, Bradley, the code you list (which I just tweaked so it'd show up, btw) has a huge problem: the "action" attribute to the FORM tag needs to be the URL of the script that is going to get the query and process it. By having it as action="#" what you're telling your Web browser is that the current page (e.g., your own page) is going to process the search query, which is, of course, incorrect. Go back to my original code and you'll see that I have a URL that's the Google search back end. Try that! Posted by: Dave Taylor at July 11, 2010 9:12 AMvery good script. send me more scripts like this . good work kep it up.......... Posted by: hamid sayyed at July 13, 2010 11:39 AMDave Thank you for your wonderful html code for adding a google search box. I have added this to the Website which I administer. I have only just started and understand very little HTML code. The search box is wonderful, but does not clear the search automatically. What other code should I use to clear the box for another search. Posted by: Angela at July 17, 2010 10:21 AMhi,, I have only just started and understand very little HTML code. Posted by: konteyner at July 27, 2010 1:32 PMHi Dave - first off, thanks!! One question...how could I set this so that part of the search phrase was predetermined, with the users entry filling in part of it? i.e. - The user types in "rules", and the search is done for ["table tennis" "australia" "rules"]? Posted by: steve at July 29, 2010 6:01 PMthnx for the code i wanna ask if i can make the results appear in my websites not in google is this possible or not Posted by: Maged at August 4, 2010 9:44 PMthank to giving me right direction. Posted by: John Rock at August 5, 2010 11:49 PMtnx very much dude,it helps to our computer project. Posted by: Fhernkenstein at August 5, 2010 11:56 PMThanks for the info I have always wondered how people did this - will be trying this out later tonight. Roger Posted by: Roger Lapin at August 8, 2010 9:56 AMThis is great - always wondered how to do it but what if I want to move the search box. Oh - don't worry i have seen some other comments about this - will try it out and see what happens Geoff. Just what I was looking for. Posted by: ken at August 9, 2010 1:10 PMHello! Thanks much for the info. I"m trying at the moment to put in a site search BUT I don't want to include the check box or the radio button. In other words I would like the default search to be my website without having to make the selection for my site or google at large. Is this easy to do. THANKS MUCH!!! Posted by: Chris Kayt at August 12, 2010 9:48 PMGREAT code! I WAS TRY TO FOUND 3 DAYS, a code like this!!!!!!! thank yu SO MUCH Posted by: Marcelo at August 15, 2010 2:06 PMGreat code. To replce the submit button by an image, just do : input type="image" src="picture.gif" name="optional" instead of input type="submit" value="Google Search" / Posted by: Pascal at August 16, 2010 2:39 PMHi everyone, thanks! Posted by: Leo at August 17, 2010 11:18 AMsir,here form method="get"..is it possible in "post" Thanks, Dave Thanks, Dave Hi.Dave i am visiting ur site.its very useful me for google code.and i also use it.its really working good.so i wil be thank for you.I wil be visit next time. Posted by: Ravi at August 24, 2010 6:51 AMI need to modify my search bar only to view pdf files. please can you say how can I do that? Posted by: Asiri Gayan at August 24, 2010 9:37 PMDave, Great search box! I recently signed up through Google, but am having great trouble understanding it so far. Yours is so nice and simple. Posted by: Liz Purcell at August 26, 2010 5:13 PMplease whow clearly that how to submit url to google id your site is very useful for me i am using your site since last three years and i found all the time it very useful please improve it Does this work with a subsite? Like I am currently using a school lab website so for example it might be: http://lab.school.edu/classroom5/1a/johnsmith/ Being that this is the URL and its not a simple www.name.com will google search this site? Posted by: Rob at August 30, 2010 1:42 PMhey dave i've added this google code to my website but i dont know how to format it, like move it around my webpage, its currently stuck in one place and i cant move it. do i need to create a div class or what? Posted by: Dylan at August 30, 2010 5:43 PMHi Dave Taylor, I have something to say, now that you mention it, but ...
I do have a comment, now that you mention it!
|
Recommended
Recent Entries
Search
I Need Help!
Apple iPad Help
Articles and Reviews Auctions and Online Shopping Blogs and RSS Feeds Building Web site traffic Business and Management Cell Phones and Mobile Phones CGI Scripts and Web Site Programming Computer and Internet Basics d) None of the Above Facebook Help HTML and CSS Industry News and Trade Shows Mac OS X Help MySpace, Twitter and Social Network Help Pay Per Click (PPC) Search Engine Optimization Shell Script Programming Sony PSP, MP3 Players, Etc. The Writing Business Unix and Linux Help Video Game Tips and Help Windows Help |