Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Quick Question about Search script
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Quick Question about Search script

 Post Reply Post Reply
Author
tam42025 View Drop Down
Newbie
Newbie


Joined: 17 March 2003
Status: Offline
Points: 6
Post Options Post Options   Thanks (0) Thanks(0)   Quote tam42025 Quote  Post ReplyReply Direct Link To This Post Topic: Quick Question about Search script
    Posted: 17 March 2003 at 7:36pm

I am trying my best to understand this so please be patient with me.  lol  Like I said in another post, I am trying to create an advanced search page using ASP.  I know how to create the search template for my viewers to use but I don't know how to customize the asp code to call up my search queries.

I have five options under my search named:'

1. "brand"  2. "starting prices"  3.  "ending prices"  4.  "item"   5.  "keywords"

this is the script I customized to bring up those 5 options when a viewer searches my site:

<HTML><BODY>

<B>Search Results for <%=Request("brand")%><%=Request("starting price")%><%=Request("ending price")%><%=Request("item")%><%=Request("keywords")%></B><BR>

<%

Const fsoForReading = 1

Dim strSearchText

strSearchText = Request("brand")("starting price") ("ending price") ("item") ("keywords")

'Now, we want to search all of the files

Dim objFSO

Set objFSO = Server.CreateObject("Scripting.FileSystemObject")

 

Dim objFolder

Set objFolder = objFSO.GetFolder(Server.MapPath("/"))

Dim objFile, objTextStream, strFileContents, bolFileFound

bolFileFound = False

For Each objFile in objFolder.Files

If Response.IsClientConnected then

Set objTextStream = objFSO.OpenTextFile(objFile.Path,fsoForReading)

strFileContents = objTextStream.ReadAll

If InStr(1,strFileContents,strSearchText,1) then

Response.Write "<LI><A HREF=""/" & objFile.Name & _

""">" & objFile.Name & "</A><BR>"

bolFileFound = True

End If

objTextStream.Close

End If

Next

if Not bolFileFound then Response.Write "No matches found..."

Set objTextStream = Nothing

Set objFolder = Nothing

Set objFSO = Nothing

%>

</BODY></HTML>

As you can see at the top I thought I could just list the names of my search queries to bring them up but that didn't work.  Does anyone know how I would bring up those 5 queries in the code above. 

 

 

 

 

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.