Probs with Mats Simple Search.

I'm having problems setting up Mats Simple Search on one of my sites, I had all the default scripts working (searching Mats test pages) then I started changing the perl to make it search my site, now it returns an empty list every time.

The search form is at  http://www.kore.co.uk/search-form.htm I think the problem is here:

# Define Variables                                                           #

$basedir = 'http://www.kore.co.uk/';
$baseurl = 'http://www.kore.co.uk/';
@files = ('http://www.kore.co.uk/');
$title = "Kore Technology";
$title_url = 'http://www.kore.co.uk/index.html';
$search_url = 'http://www.kore.co.uk/search-form.htm';

# Done                                                                       #

Any ideas?

Stephen
LVL 1
stevespencerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
alamoConnect With a Mentor Commented:
I am confused as to why you've done something completely different than what I said and then what you repeated back. Please confirm that you have tried the following (I omitted ones which didn't change):

$basedir = '../';
@files = ('*.htm','*.html');

As I said before $basedir = '../' should work, but if it doesn't try the whole directory path. (tell me what that path is and I'll confirm).

If this still doesn't work, tell me what about it doesn't work.
0
 
alamoCommented:
The problem is in your setting of $basedir and @files. These values need to be paths on your machine, not URLs.

For example, if your root www directory is /home/wwwroot/, then you would set
$basedir = '/home/wwwroot/';

If the files you wanted your users to search were all .htm files and were all in your wwwroot directory, then you would set:
@files = ('*.htm');

Since @files is an array, you can enter multiple entries if you want the searches to search multiple directories.

If this isn't clear, tell me what the directories and file names are on your system which you want to search, and I'll tell you what these values should be. Good luck!
0
 
stevespencerAuthor Commented:
Thanks, the complete URL is http://www.kore.co.uk/ there are sub-dirs cotaining images and scripts and stuff, but I want to search the root, ie www.kore.co.uk/ thte html calling the simple search is in this directory and the perl is in cgi-bin/ so the @files string shoud be '*.htm','*.html' and the $basedir should be ../?

How am I doing?

Stephen
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
alamoCommented:
Looks like that will work.

If it doesn't work, try changing the basedir to the full path - the script does a chdir to get to the base directory, and using ../ assumes the current directory is set to the directory the script is in. This is true on almost all systems so it should work just fine, I mention it just in case there is a problem.

Let me know how it goes!
0
 
stevespencerAuthor Commented:
Tried that and now I have tried this, Stiil doesnt work!

# Define Variables                                                           

$basedir = 'http://www.kore.co.uk/';
$baseurl = 'http://www.kore.co.uk/';
@files = ('http://www.kore.co.uk/*.htm','http://www.kore.co.uk/*.html');
$title = "Kore Technology";
$title_url = 'http://www.kore.co.uk/index.html';
$search_url = 'http://www.kore.co.uk/search-form.htm';

# Done            

Anybody else got any good ideas?

Stephen
0
 
stevespencerAuthor Commented:
read my last comment, I did try it, and the full path version. The search form is at

       http://www.kore.co.uk/search-form.htm

Try searching for kore, you should get about 50 pages, but you will get none.

The search.pl is in the directory http://www.kore.co.uk/cgi-bin/search.pl
I want to search the directory http://www.kore.co.uk/

Stephen
0
 
alamoCommented:
What you posted as the values you tried were much different than what I expected, so I wanted to make sure you didn't misunderstand.

Since you used the web-address where the local drive path was expected, I want to double-check that when you used the full path for $basedir you used the local drive path. I would have expected something like: $basedir = '/home/kore/';
0
 
alamoCommented:
I think there's a lot of confusion here over the way the directories are set up by your ISP, and that's part of the problem.  The search.pl is not at the address you gave; it's actually at http://www.kore.co.uk/cgi-bin/www.kore.co.uk/search.pl. This isn't so surprising because of the fact many ISPs use a virtual directory for scripts, but it could well mean ../ won't work and you need the correct full path of the directory containing the htmls.
0
 
stevespencerAuthor Commented:
good point, I'l work on it.

Stephen

0
All Courses

From novice to tech pro — start learning today.