Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems Executing Search Engine 1

Status
Not open for further replies.

zoeythecat

Technical User
May 2, 2002
1,666
US
Hi All,

I am having problems executing a search engine on my public web server. I have no problems executing this search engine locally in Front Page. The way I creating the search engine was by copying and pasting a java script from a website and pasting the code into an open html page and then saving the file as a *.htm file in Front Page. Again, I have no problems running this search engine from my local hard drive in Frontpage. I FTP this file up to my public webserver which is on a Unix Box. When in this FTP program if I click on the "exec" for this file from the directory on the webserver it comes up and executes so I know the code is right. But when I go to the webpage from Internet Explorer and click on the SiteSearch button the following, "The Page Cannot be found".

Anything I may be doing wrong or need to do?

Thanks in advance!
Zoey
 
there's not really much to go by for a solution that I can see. are you certain this is the name searchengine1.htm
what is the structure of the .htm page
ig
head
body
etc..

is there any server side scripting involved in the code you copied? what is the link to the open source that you're using? _________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
 
The Sitesearch button attempts to pull in "searchengine1.htm" which is a file that sits in the directory by itself. It should pull up a Search Window. Here is the code from it. I think like you mentioned it may be server related, something I have to do on the Unix box? I thought maybe because it was initially "ReadOnly" but I have since changed the permissions of the file to be executable (RWXR - RX)

TIA

___________________________________________________________
<html>

<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<title>Brooks Search Engine</title>
<TITLE>Search Engine</TITLE>
<META http-equiv=Content-Type content=&quot;text/html; charset=windows-1252&quot;>
<SCRIPT>

<!-- Begin copyright - This must be retained and posted as is to use this script -->

<!--// This Script was created by Satadip Dutta.
// Email: sat_dutta@post1.com / satadipd@inf.com
// URL:// Version 1.1-IExp
// Please honor my hard work, if you use a variant of this in your page,
// then please email me :) and keep these comments in the Script.
// This code is Copyright (c) 1997 Satadip Dutta
// all rights reserved.
// License is granted to user to reuse this code on their own Web site
// if, and only if, this entire copyright notice is included. The Web Site
// containing this script must be a not-for-profit ( non-commercial ) web site.
// Exclusive written permission must be obtained before using this version of the search engine
//-->

<!-- End copyright - This must be retained and posted as is to use this script -->

title = new Object();
desc = new Object();
links= new Object();
matched= new Object();
keywords= new Object();
found= new Object();
var temp=0;
// actual location or the item to be searched
// description of he location
// actual link
// percentage match found
// keywords as parsed from the input
// # of titles present in the database
title[0]=1
//no of keywords after parsing
keywords[0]=0
//no of matches found.
found[0]=0

<!-- Begin List of Searchable Items -->

<!--put the list of the links and descriptions here!!-->

title[1]=&quot;Helpdesk&quot;
desc[1]=&quot;Helpdesk Main Page&quot;
links[1]=&quot;matched[1]=0

title[2]=&quot;objects document function parameter last modified date&quot;
desc[2]=&quot;JavaScript Primer (Part 2 of 2) &quot;
links[2]=&quot;matched[2]=0

title[3]=&quot;alert confirm prompt box pop up dialog&quot;
desc[3]=&quot;Creating Alert, Confirm, and Prompt Boxes&quot;
links[3]=&quot;matched[3]=0

title[4]=&quot;event handler onClick onLoad onMouseover onMouseout onUnload&quot;
desc[4]=&quot;Understanding Event Handlers in JavaScript&quot;
links[4]=&quot;matched[4]=0


title[5]=&quot;object model tree accessing forms &quot;
desc[5]=&quot;Accessing and Validating Forms Using JavaScript (Part 1 of 2)&quot;
links[5]=&quot;matched[5]=0

title[6]=&quot;form validation onBlur onSubmit&quot;
desc[6]=&quot;Accessing and Validating Forms Using JavaScript (Part 2 of 2)&quot;
links[6]=&quot;matched[6]=0



title[7]=&quot;date object write html setTimeout function&quot;
desc[7]=&quot;Creating Time Dependent Scripts using JavaScript (Part 1 of 2)&quot;
links[7]=&quot;matched[7]=0


title[8]=&quot;live clock watermark&quot;
desc[8]=&quot;Creating Time Dependent Scripts using JavaScript (Part 2 of 2)&quot;
links[8]=&quot;matched[8]=0


title[9]=&quot;image preload rollover effect filter&quot;
desc[9]=&quot;Images and JavaScript- Apples and Apples (Part 1 of 2)&quot;
links[9]=&quot;matched[9]=0


title[10]=&quot;rollover effect&quot;
desc[10]=&quot;Images and JavaScript- Apples and Apples (Part 2 of 2)&quot;
links[10]=&quot;matched[10]=0

title[11]=&quot;new window open secondary reload close toolbar menubar status bar &quot;
desc[11]=&quot;Windows and JavaScript&quot;
links[11]=&quot;matched[11]=0

title[12]=&quot;frames access object multiple&quot;
desc[12]=&quot;Loading Two frames with one link.&quot;
links[12]=&quot;matched[12]=0

title[13]=&quot;selection list options array text vale&quot;
desc[13]=&quot;I'll hava a double combo please (Part 1 of 2)&quot;
links[13]=&quot;matched[13]=0

title[14]=&quot;combo link box jump&quot;
desc[14]=&quot;I'll hava a double combo please (Part 2 of 2)&quot;
links[14]=&quot;matched[14]=0

<!-- End list of Searchable items -->

function search(){
var skeyword=document.searchengine.keywords.value.toLowerCase();
var check=1;
var pos=0;
var i=0;
var j=0;
var itemp=0;
var config='';

while (true)
{
if (skeyword.indexOf(&quot;+&quot;) == -1 )
{
keywords[check]=skeyword;
break;
}
pos=skeyword.indexOf(&quot;+&quot;);
if (skeyword !=&quot;+&quot;)
{
keywords[check]=skeyword.substring(0,pos);
check++;
}
else
{
check--;
break;
}
skeyword=skeyword.substring(pos+1, skeyword.length);
if (skeyword.length ==0)
{
check--;
break;
}

}
// the keywords have been put in keywords object.
keywords[0]=check;

// matching and storing the matches in matched
for ( i=1; i<=keywords[0];i++)
{
for (j=1;j<=title[0];j++)
{
if (title[j].toLowerCase().indexOf(keywords) > -1 )
{
matched[j]++;
}
}
}
// putting all the indexes of the matched records in found

for (i=1;i<=title[0];i++)
{
if (matched > 0 )
{
found[0]++;
// increment the found
found[found[0]]=i;

}
}



for (i=1;i<=found[0]-1;i++)
{
for(j=i+1;j<=found[0];j++)
{
if ( matched[found]< matched[found[j]] )
{
temp= found[j];
found[j]=found;
found=temp;
}
}
}

// end of sort

output = self;
output.document.write('<html>');
output.document.write('<head>');
output.document.write('<script>');
output.document.write('window.onerror=new Function(&quot;return true&quot;)');
output.document.write('<\/script>');
output.document.write('<title> Search Results </title>');
output.document.write('</head>');
output.document.write('<BODY bgcolor=#ffffff text=#000000 link=#990099 vlink =#339966 >');

output.document.write('<center> <h1> Search Results </h1></center>');
output.document.write('<hr>');
output.document.write(' The Keyword(s) you searched :: '.big() )
for (i=1; i<=keywords[0]; i++)
{
output.document.write( keywords.bold() +&quot; &quot;);
}
output.document.write('<br>');

if (found[0]==0)
{
//alert(found[0]);
output.document.write('<hr>');
output.document.write(&quot;<b>No matches resulted in this search </b> <br>&quot;);
output.document.write(&quot;You may close the results and reduce the length/number of the keywords <br>&quot;);
}
else
{
// data has been found
output.document.write(&quot; <hr> <b> The Results of the search are : </b> &quot;);
output.document.write( found[0] +&quot; Entries found &quot;.italics());
output.document.write(&quot;<table border=1 width=100%>&quot;);
for (i=1; i<=found[0];i++)
{
output.document.write(&quot;<tr><td valign=top bgcolor=#9999ff>&quot;);
output.document.write(&quot;<h3>&quot; +i +&quot;</h3>&quot;);
output.document.write(&quot;<td valign=top>&quot;);
itemp=found;
output.document.write(desc[itemp].bold() +&quot;<br>&quot; +
links[itemp].link(links[itemp])+&quot;<br>&quot;);
temp= (matched[itemp]/keywords[0])*100
output.document.write(&quot;<i> Matched with keywords :: &quot; +temp+&quot; % </i>&quot; );
matched[itemp]=0
}
found[0]=0;
output.document.write(&quot;</table>&quot;);
}
output.document.write ('This search was created by &copy <a href=&quot;http:\\dutta.home.ml.org&quot;> Satadip Dutta</a> 1997');
output.document.write (&quot;<hr>&quot;);
//output.document.write (&quot;<form><center>&quot;);
output.document.write(&quot;<center>Hit the refresh button to return to the search<center>&quot;);
//output.document.write (&quot;<input type='button' value='Start Another Search' onClick = 'self.close()'&quot;);
//output.document.write (&quot;<center></form>&quot;);

output.document.write (&quot;</body></html>&quot;);
output.document.close();
}
</SCRIPT>

<META content=&quot;Microsoft FrontPage 4.0&quot; name=GENERATOR>
</head>

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>
<!-- saved from url=(0045) -->
<!--------------------------------------------------------------------------------
Please remove this section from the actual page when
you actually use this page.

Here are the thing you need to modify in the page

1.title[0]=no_of_urls
( this is for the total number of urls which will be searched )

2. fill in the the details

title[1]=&quot;fill in the list of keywords here&quot;
desc[1]=&quot;fill in the description of the url here &quot;
links[1]=&quot;
(rememeber all of these should be encapsulated in the quotes)
(all the keywords should be seperated by blanks and should be in lowercase)

3. You can also change the heading of results
Replace 'Search Results' by 'your_title'

Copyright for all the HTMLSearch code rests with with Satadip Dutta
//------------------------------------------------------------------------->
<BODY text=black vLink=#6600aa aLink=#6600aa link=#0000ff bgColor=white>
<CENTER>
<H1>Search Engine</H1></CENTER>
<HR>
This is a search engine implemented in Javascript. You will need a Java Script
enabled browser to run this search.
<HR>

<P></P>
<TABLE cellSpacing=5 cellPadding=5 border=0>
<TBODY>
<TR>
<TD align=left width=&quot;20%&quot;>This search is NOT case sensitive. </TD>
<TD align=left width=&quot;80%&quot;>Put &quot;+&quot; between keywords in a list if using
more than one keywords. </TD></TR></TBODY></TABLE>
<FORM name=searchengine onsubmit=search()>
<CENTER>Keywords: <INPUT maxLength=40 name=keywords> <INPUT onclick=search() type=submit value=SEARCH name=go> <BR>
<HR>
<FONT size=-1>This search was created by © <A
href=&quot; Dutta</A>
1997<BR></FONT></CENTER></FORM>
</BODY>
</HTML>
 
The file just doesn't seem to be there. Double check the spelling of the file to make sure. Type in the exact address of the file into the address bar to confirm that it is where it's supposed to be.


É ::
 
first thing)
are you FTPing or using FrontPAge to publish the page to the site.
FTPing a FrontPAge .htm is not something you want to do as it can damage the file and make it none viewable or function correctly.

try resaving the page in a .htm without the FrontPAge crud that gets added and using IE to ftp it or ws_ftp etc.
this will take take out the additions of the FrontPage extensions and all the other crud that is placed in the code.

server meaning server scripting. but there is none from looking at what you pasted. _________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
 
onpnt,

Thanks for your help. Solution was to open up a new page in frontpage and paste the information again. I saved it as a different file, did the FTP up to the server and bingo, the search executes. The thing that threw me off was that it was working locally when viewing in frontpage. Maybe I should just purchase DreamWeaver.

Anyway, thanks for your help.

Zoey
 
DreamWeaver would be a far better choice then FrontPAge as far as ease of adding to things and the freedom of how you can manipulate the site or sites. FrontPage tends to be a killer for developing sites that will go to the next step in some development as far as scripting goes.


glad you got it going and thanks for the star. _________________________________________________________
for the best results to your questions: FAQ333-2924
Is your question a most FAQ?? Find out here FAQ333-3048
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top