Solved

Probs with Mats Simple Search.

Posted on 1998-06-24
9
269 Views
Last Modified: 2013-12-25
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
0
Comment
Question by:stevespencer
  • 5
  • 4
9 Comments
 
LVL 6

Expert Comment

by:alamo
ID: 1829932
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
 
LVL 1

Author Comment

by:stevespencer
ID: 1829933
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
 
LVL 6

Expert Comment

by:alamo
ID: 1829934
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
 
LVL 1

Author Comment

by:stevespencer
ID: 1829935
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 6

Accepted Solution

by:
alamo earned 100 total points
ID: 1829936
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
 
LVL 1

Author Comment

by:stevespencer
ID: 1829937
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
 
LVL 6

Expert Comment

by:alamo
ID: 1829938
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
 
LVL 6

Expert Comment

by:alamo
ID: 1829939
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
 
LVL 1

Author Comment

by:stevespencer
ID: 1829940
good point, I'l work on it.

Stephen

0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Ever wondered how to display how many visitors you have online. In this tutorial I will show you an easy but effective way to display the number of online visitors in WhizBase. In this article I assume you have read my previous articles and know …
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now