TECHY HELP: Including Search Facility on Websites... - HotUKDeals
We use cookie files to improve site functionality and personalisation. By continuing to use HUKD, you accept our cookie and privacy policy.
Get the HUKD app free at Google Play

Search Error

An error occurred when searching, please try again!

Login / Sign UpSubmit

TECHY HELP: Including Search Facility on Websites...

Disco Avatar
8y, 4m agoPosted 8 years, 4 months ago
as above....... how easy is it, and how could I do it?

http://www.gentlehands.co.uk/blue

Cheers people!!
Disco Avatar
8y, 4m agoPosted 8 years, 4 months ago
Options

All Comments

(27) Jump to unreadPost a comment
Comments/page:
#1
It would really depend how your content is stored, initial looks suggest the content is static and not created via any scripting / database combination.

With some clever scripting, usually PHP, you could add a section which would parse your current pages for keywords.

However, I would suggest you go with a pre-made solution, more specifically Google's Site Search.

There will be plenty of documentation and existing users out there, so any problem you encounter will no doubt, be already solved.

SilverB.
#2
site contains a CSS, if that helps?
#3
Get HUKD to do it for you, I'm sure they'll make sure stuff is impossible to find...ba-zing

Honestly though your site doesn't seem content loaded so I don't see why you would need a search facility, tacked on search functions usually work badly and make the site look unprofessional.
#4
MoneySavingG
Get HUKD to do it for you, I'm sure they'll make sure stuff is impossible to find...ba-zing

Honestly though your site doesn't seem content loaded so I don't see why you would need a search facility, tacked on search functions usually work badly and make the site look unprofessional.


yea thats what i thought, but OH wants one ...
#5
Google is the easiest one to use. Problem is, any pages on your site that are not indexed with Google will not come up on the results.

This page will show you which pages are indexed with Google:
http://www.google.co.uk/search?hl=en&q=site:www.gentlehands.co.uk/blue

I think all your pages are indexed so you should be okay. Although seven pages, as already has been mentioned, really doesn't need a search function. I can understand why people like them, but your site is very easy to navigate and a search function will merely add to an already perfectly simple and elegant website layout.
#6
cheers so far guys, this is what im after......

SEARCH FACILITY ON SITE

Am i still right in thinking Google is the way forward! ?
#7
Google is very simple to do as it uses Javascript. You merely copy and paste and if you follow it correctly you will have a working search function in a matter of minutes.
#8
PhearFactor
Google is very simple to do as it uses Javascript. You merely copy and paste and if you follow it correctly you will have a working search function in a matter of minutes.


Im confused already! :?
#9
http://www.google.com/coop/cse/

Follow the instructions hehe
#10
either include a custom google searcfh engine (through google adsense) or build your own :-D

create a form like this






then search.php shall contain a search script (google for it)

if you need one i can do it (but will cost ya)

the easiest way is google, you can set it to search the web, your website or both, and you get money from it :-D
#11
cheers for that, i think?

erm.. now in explain please! ;-)

PM me if ya want, may be intrested, but remember I'm just starting out, so will pay you in kind! :oops:
#12
Disco
cheers for that, i think?

erm.. now in explain please! ;-)

PM me if ya want, may be intrested, but remember I'm just starting out, so will pay you in kind! :oops:


put the code i put up there, where you want the search bar to be ........

when the user presses the submit button it goes to submit.php which will contain the search queries........

as your site is a basic html one, you won't need database queries so will be pretty simple

gimme 5 to find the code :-D
#13
okay got the script, not tested,....... does your web server have php enabled ???

the code is

name this search.php


// set maximum search time

set_time_limit("600");

// get search term

$keyword=trim($_POST["search"]);

// checks if no search words entered

if($keyword==""){

echo"Please enter your keyword";

exit; }

// opens and finds all website files

function listFiles($dir,$keyword,&$array){

$handle=opendir($dir);

while(false!==($file=readdir($handle))){

if($file!="."&&$file!=".."){

if(is_dir("$dir/$file")){

listFiles("$dir/$file",$keyword,$array);

}

else{

$data=fread(fopen("$dir/$file","r"),filesize("$dir/$file"));

if(eregi("]+)>(.+)",$data,$b)){

$body=strip_tags($b["2"]);

}

else{

$body=strip_tags($data);

} if($file!="search.php"){

if(eregi("$keyword",$body)){

if(eregi("(.+)",$data,$m)){

$title=$m["1"];

}

else{

$title="no title";

}

$array[]="$dir/$file $title";

}

}

}

}

}

}

$array=array();

listFiles(".","$keyword",$array);

foreach($array as $value){

list($filedir,$title)=split("[ ]",$value,"2");

echo "$title "."
\n";

} ?>

basically as you don't have your files in a database, the script doesnt search that, but takes a copy of all your website files and searches them for the keywords you enter :-D

let me know if i doesn't work
#14
cheers for that.. erm... PHP enabled.. I only have the 1&1 Home Package? :?

Should i have it?
#15
Disco
cheers for that.. erm... PHP enabled.. I only have the 1&1 Home Package? :?

Should i have it?


yes it does :-D pain in butt to find the info tho lol
#16
oh does it? when ya find it can ya tell me! lol

Would you recommend the addition of a couple of relevant photos, or would you just leave the site as it is, (With or without the search tool)
#17
you don't really need the search tool unless you have hundreds of pages & hard to find content .......

yours is laid out easily so a search tool wouldn't be much use
#18
faevilangel
you don't really need the search tool unless you have hundreds of pages & hard to find content .......

yours is laid out easily so a search tool wouldn't be much use


I know, OP have said that but the OH is adamant she wants one? :thinking:
#19
Disco
I know, OP have said that but the OH is adamant she wants one? :thinking:


hmmmm :| waste of time ......... won't be much use unless you get a lot more content :|
#20
faevilangel
hmmmm :| waste of time ......... won't be much use unless you get a lot more content :|


k, ill tell her AGAIN, that im wastin my time! :thumbsup:
#21
Disco
k, ill tell her AGAIN, that im wastin my time! :thumbsup:


spare room for you tonite :whistling:
banned#22
I just use this one. Works well enough (and free)
#23
guv
I just use this one. Works well enough (and free)


cant be doin with ads, this is a professional set up you know! :whistling:
banned#24
Disco
cant be doin with ads, this is a professional set up you know! :whistling:


If its proffessional, you can afford to pay for it!

Cant see whats wrong with this!
#25
guv
If its proffessional, you can afford to pay for it!

Cant see whats wrong with this!


so whats ya point there Guv?
#26
guv
If its proffessional, you can afford to pay for it!

Cant see whats wrong with this!


why pay for one or use a ad based one :| when i built (copied) a decent one :p
#27
faevilangel
why pay for one or use a ad based one :| when i built (copied) a decent one :p


i know, and i'll use it once i know how to enable PHP!!

Post a Comment

You don't need an account to leave a comment. Just enter your email address. We'll keep it private.

...OR log in with your social account

...OR comment using your social account

Thanks for your comment! Keep it up!
We just need to have a quick look and it will be live soon.
The community is happy to hear your opinion! Keep contributing!