Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Probs with Mats Simple Search.

Posted on 1998-06-24
9
Medium Priority
?
279 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
[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

618 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