M
M. Anderson
I have inserted a call to an asp page to do a site search
Here is the code that I can put on any page to do a search
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>Search term or phrase</title></head><table border=0 cellpadding=5 bgcolor=#AAAAAA><form method="POST" action="search.asp"><tr><td>Search term or phrase <input type=text name=term size=15> <input type=submi
value="search"></td></tr></form></table><body></body></html
That works great and then I have the results page
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>Search term or phrase</title></head><body><%
DIM Listoffilesfound,Thefile,Thefolder,Folderpat
if request.form="" the
SendForm(
els
SearchTerm = Server.HTMLencode(request.form("term")
SearchTermArray=Split(SearchTerm," "
MaxSearchTerms=ubound(SearchTermArray
Filestosearch="/index.htm,/bio.htm,/issues.htm,/newsletter.htm,/photogallery.htm
DonotsearchthisFiles ="
Folderpath=server.mappath("\"
' Search file
FilestosearchArray=Split(Filestosearch,","
Maxfiles=ubound(FilestosearchArray
for i=0 to Maxfile
Thefile = FilestosearchArray(i
Searchit(
nex
' Write search result
Searchresponse(
end i
%><% Sub SendForm() %><HTML><HEAD><TITLE>Search</TITLE></HEAD><BODY BGCOLOR=FFFFFF><CENTER><form method="POST" action="search.asp"><table border=0 cellpadding=5 bgcolor=AAAAAA><tr><td align=center>
Search term or phrase <input type=text name=term size=15> <input type=submi
value="search"></td></tr></table></form></CENTER></BODY></HTML><% End Sub %><% Sub Searchresponse() %><HTML><HEAD><TITLE>Search results</TITLE></HEAD><BODY BGCOLOR=FFFFFF><CENTER><TABLE BORDER=0 WIDTH=600><TR><TD BGCOLOR=#9999FF><p align="center"><FONT SIZE=5 face="Trebuchet MS" color="#FFFFFF"><B>Search Results</B></FONT></TD></TR></TABLE><TABLE BORDER=0 WIDTH=600><% if Listoffilesfound="" then %><TR><TD>The specified term or phrase was not found</TD></TR><% else
Response.Write (Listoffilesfound)
end if %></TABLE><TABLE BORDER=0 WIDTH=600><TR><TD BGCOLOR=#9999FF ALIGN=RIGHT> </TD></TR></TABLE></CENTER></BODY></HTML><% End Sub %><% Sub Searchit()
Thefilepath=Folderpath & Thefil
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.OpenTextFile(Thefilepath)
ThecontentofFile = a.ReadAll
a.close
Findterms=
for j=0 to MaxSearchTerm
if instr(1,ThecontentofFile,SearchTermArray(j),1)>0 then
Findterms=Findterms+
end i
nex
if Findterms=MaxSearchTerms+1 then
if instr(1,ThecontentofFile,"</title>",1)>0 and instr(1,ThecontentofFile,"<title>",1)>0 then
TheTitle=left(ThecontentofFile,instr(1,ThecontentofFile,"</title>",1)-1)
TheTitle=right(TheTitle,len(TheTitle)-instr(1,TheTitle,"<title>",1)-6)
els
TheTitle="No Title
end if
Listoffilesfound= Listoffilesfound & "<TR><TD>" & TheTitle & "</TD><TD ALIGN=CENTER VALIGN=MIDDLE><A HREF=" & Thefile & "> More </A></TD></TR>"
end i
End Sub %></body></html
the urls that they attach to are www.votekahn.com/searchtest.asp which has the search box an
www.votekahn.com/search.asp which displays the result
My question is, is there any way that I can customize the results page that pops up to display more information. Like a couple of sentences with the keyword in it, or the date last updated, so on and so forth
If you look at it know the search.asp page comes up with just page names, and nothing about the search word entered
Thanks for any help in advance
M. Anderson
Here is the code that I can put on any page to do a search
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>Search term or phrase</title></head><table border=0 cellpadding=5 bgcolor=#AAAAAA><form method="POST" action="search.asp"><tr><td>Search term or phrase <input type=text name=term size=15> <input type=submi
value="search"></td></tr></form></table><body></body></html
That works great and then I have the results page
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><title>Search term or phrase</title></head><body><%
DIM Listoffilesfound,Thefile,Thefolder,Folderpat
if request.form="" the
SendForm(
els
SearchTerm = Server.HTMLencode(request.form("term")
SearchTermArray=Split(SearchTerm," "
MaxSearchTerms=ubound(SearchTermArray
Filestosearch="/index.htm,/bio.htm,/issues.htm,/newsletter.htm,/photogallery.htm
DonotsearchthisFiles ="
Folderpath=server.mappath("\"
' Search file
FilestosearchArray=Split(Filestosearch,","
Maxfiles=ubound(FilestosearchArray
for i=0 to Maxfile
Thefile = FilestosearchArray(i
Searchit(
nex
' Write search result
Searchresponse(
end i
%><% Sub SendForm() %><HTML><HEAD><TITLE>Search</TITLE></HEAD><BODY BGCOLOR=FFFFFF><CENTER><form method="POST" action="search.asp"><table border=0 cellpadding=5 bgcolor=AAAAAA><tr><td align=center>
Search term or phrase <input type=text name=term size=15> <input type=submi
value="search"></td></tr></table></form></CENTER></BODY></HTML><% End Sub %><% Sub Searchresponse() %><HTML><HEAD><TITLE>Search results</TITLE></HEAD><BODY BGCOLOR=FFFFFF><CENTER><TABLE BORDER=0 WIDTH=600><TR><TD BGCOLOR=#9999FF><p align="center"><FONT SIZE=5 face="Trebuchet MS" color="#FFFFFF"><B>Search Results</B></FONT></TD></TR></TABLE><TABLE BORDER=0 WIDTH=600><% if Listoffilesfound="" then %><TR><TD>The specified term or phrase was not found</TD></TR><% else
Response.Write (Listoffilesfound)
end if %></TABLE><TABLE BORDER=0 WIDTH=600><TR><TD BGCOLOR=#9999FF ALIGN=RIGHT> </TD></TR></TABLE></CENTER></BODY></HTML><% End Sub %><% Sub Searchit()
Thefilepath=Folderpath & Thefil
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.OpenTextFile(Thefilepath)
ThecontentofFile = a.ReadAll
a.close
Findterms=
for j=0 to MaxSearchTerm
if instr(1,ThecontentofFile,SearchTermArray(j),1)>0 then
Findterms=Findterms+
end i
nex
if Findterms=MaxSearchTerms+1 then
if instr(1,ThecontentofFile,"</title>",1)>0 and instr(1,ThecontentofFile,"<title>",1)>0 then
TheTitle=left(ThecontentofFile,instr(1,ThecontentofFile,"</title>",1)-1)
TheTitle=right(TheTitle,len(TheTitle)-instr(1,TheTitle,"<title>",1)-6)
els
TheTitle="No Title
end if
Listoffilesfound= Listoffilesfound & "<TR><TD>" & TheTitle & "</TD><TD ALIGN=CENTER VALIGN=MIDDLE><A HREF=" & Thefile & "> More </A></TD></TR>"
end i
End Sub %></body></html
the urls that they attach to are www.votekahn.com/searchtest.asp which has the search box an
www.votekahn.com/search.asp which displays the result
My question is, is there any way that I can customize the results page that pops up to display more information. Like a couple of sentences with the keyword in it, or the date last updated, so on and so forth
If you look at it know the search.asp page comes up with just page names, and nothing about the search word entered
Thanks for any help in advance
M. Anderson