I am trying to develop an ASP page for one of the websites I am developing that will be used to search words in the site and display results like Google or Yahoo. Can anyone tell me which VB Script function to use?
No function will do this for you, but a mix of different techniques.
The steps you'll need to take in the easiest developmental wise process to perform this are
1) Create the form for the user interaction.
Use this object to get all the files in the directories you wish to search. Then you need to bring them in and loop through them. The common way to either include or not include files is a content meta tag or whatever stating a term such as, NOINDEX or INDEX.
3) while looping through the files you can use InStr() (or a more advanced way with regular expressions) to validate text values the user entered against the contents of the file.
If InStr(fileContents, userValue) > 0 Then
Match found
End If
4) At this point you would have created a running variable to hold the files that were found to contain the values entered. All you need to do now is construct a link from that file name. So say the variable you created has a delimiter of #### and you found all these files to hold the word "database"
filesFound = databaseConcepts.asp####mydatabaseresults.asp
What you need to do is just split on the #### delimiter and then construct the links
mylinks = split(filesFound,"####"
Do while x <= ubound(myLinks)
response.write "<a href='" & myLinks & "'>"
x = x + 1
Loop
Of course formatting etc. set aside.
So other then a chopped up explanation and list this should get you going in what you need to first
Research and then what step to take in what order.
____________________________________________________ The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-3811
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.