...

View Full Version : HeLP!! How to create a search box to search within my own website



j3nnif3r
06-13-2004, 01:12 AM
[FONT=Times New Roman]undefined[/FONundefinedT]

Hi.

I am creating a website and I wanted to know the javascript for creating a search box that searches ONLY within my own website (no searching search engines) ?? I want to place a search box on every page of my website. I would really appreciate anyone who could help me out with this. THanks!

A1ien51
06-13-2004, 02:29 AM
http://www.javascriptkit.com/script/cutindex14.shtml

j3nnif3r
06-13-2004, 11:59 PM
Hi Alien51.

I went to the site you replied with. But i don't see where i would put the URL for my website? Can you help me with that? (i'm sorry, im a newbie,so i don't quite know javascript too well, but thanks for helping me out! :) ) I really appreciate it. Also, do you know how to modify this script provided in the link if i wanted to change the search box to ASP so that it would pull from the database? Thanks so much!!

Anyone who can help, please do! Thanks in advance!

the_bob
06-14-2004, 12:04 AM
umm...i'm not sure, but i think you dont need to enter your URL. it just searches the site you host it at

not positive, just a guess

try it out and see

glenngv
06-14-2004, 06:01 AM
You don't want google to search your site?


<form method="GET" action="http://www.google.com/search">
<input type="text" name="q" size="31" maxlength="255" />
<input type="submit" name="btnG" VALUE="Search" />
<input type="hidden" name="domains" value="YOUR DOMAIN NAME" />
<input type="hidden" name="sitesearch" value="YOUR DOMAIN NAME" />
</form>

j3nnif3r
06-23-2004, 06:35 PM
Hi Glenngy.

Thanks for your coding, but this is not exactly what i wanted. I actually don't want a search engine results page, but i wanted to do a search within my website, where after a user types in keywords in the searchbox, the results would be displayed on another page, but still within my website. Thanks again though. CaN anyone else help??

-j3nnif3r.

faxm0dem
06-23-2004, 10:52 PM
Hi Glenngy.

Thanks for your coding, but this is not exactly what i wanted. I actually don't want a search engine results page, but i wanted to do a search within my website, where after a user types in keywords in the searchbox, the results would be displayed on another page, but still within my website. Thanks again though. CaN anyone else help??

-j3nnif3r.

You can install a search engine like phpdig, but then again it needs some fiddling'n'tweaking maybe you were looking for a click'n'go solution?

SlySecretSpy
06-24-2004, 12:31 AM
Perhaps you could code a script the spiders the dom on each page and returns results based on single keyword finds.

In this situation your going to have to have a configuration file to list the pages that you need your spider to be able to search.

Then again you could code it so it would only search logical internal links on your site. Load all the links from the DOM then loop through them, store the pages you already searched, then visit the new links and search that dom for more links, all while maintaining a single array of already searched pages. Have it continue the process untill it no longer finds any links.

j3nnif3r
06-24-2004, 01:20 AM
Hi Faxm0dem and Slysecretspy. For faxm0dem, i wanted to use javascript and an asp database for creating the searchbox, but would you like to post the scipt for the scenario you described? For Slysecretspy, could you also post scripts for the different cases/scenarios you described? Thanks again.


-j3nnif3r.

glenngv
06-24-2004, 02:37 AM
Hi Glenngy.

Thanks for your coding, but this is not exactly what i wanted. I actually don't want a search engine results page, but i wanted to do a search within my website, where after a user types in keywords in the searchbox, the results would be displayed on another page, but still within my website. Thanks again though. CaN anyone else help??

-j3nnif3r.
The code I posted will do a Google search in YOUR site only. You only have to add form target to open the search result in a new window.

<form method="GET" action="http://www.google.com/search" target="_blank">

Unless your site is an intranet or you want your own search layout, you can use that code without the need for server-side scripting.

j3nnif3r
06-24-2004, 06:51 AM
I understand what you meant in your coding, but i dont think i correctly stated what i wanted. Your script is very helpful, but i was wondering if i was able to do a search, where the header did not appear as "google" or any other search engine. Thanks again.

-j3nnif3r.

faxm0dem
06-24-2004, 07:54 AM
Hi Faxm0dem and Slysecretspy. For faxm0dem, i wanted to use javascript and an asp database for creating the searchbox, but would you like to post the scipt for the scenario you described? For Slysecretspy, could you also post scripts for the different cases/scenarios you described? Thanks again.


-j3nnif3r.

won't help you much I guess if you're using asp this scipt I'm talking of is php.
never mind here it is, there's even a demo available on the site:

http://www.phpdig.net/

glenngv
06-24-2004, 09:02 AM
Read about Microsoft Index Server (http://www.google.com/search?hl=en&ie=UTF-8&q=%22Microsoft+Index+Server%22).

Mr J
06-24-2004, 08:33 PM
Take a look at the search I use on my site, is this what you are after

This was coded by Jamie Jaworski and it is pretty easy to set up

www.huntingground.freeserve.co.uk

Click Search Me in the left menu

j3nnif3r
06-25-2004, 04:55 AM
HI Mr. J. The search box is very close to what i want. I was wondering if there was someway to modify the search?? So that there is only the search box where the user can type in the keyword, but no selecting multiple keywords box and no options on the side (no select keywords from list option, or match any keyword, or match all keywords). Basically, im asking if the code can be modified for just the rectangle box for the user to type in keyword(s) and the search button. Is that possible?? Thanks again for your help. I greatly appreciate it.

-j3nnif3r.

Mr J
06-25-2004, 02:24 PM
Yes.

Contact me through my site so that I can send you a sample

j3nnif3r
06-26-2004, 06:29 PM
Hi Mr J.

I just emailed you. Thanks again for your help.


-j3nnif3r.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum