Solved

Probs with Mats Simple Search.

Posted on 1998-06-24
9
277 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Resolve Critical IT Incidents Fast

If your data, services or processes become compromised, your organization can suffer damage in just minutes and how fast you communicate during a major IT incident is everything. Learn how to immediately identify incidents & best practices to resolve them quickly and effectively.

 
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
 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will focus on how to use WhizBase as a tool for sending ICQ messages to ICQ. Here I will use a new technology in WhizBase, published in WhizBase 5.1 version. In this tutorial I will use 3 files, pager.wbsp for the processing, e…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

728 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