Click to See Complete Forum and Search --> : Running ASP


The Little Guy
06-22-2005, 12:16 PM
I downloaded Some ASP files from Here (http://www.webwizguide.info/asp/default.asp), and when I run them on my browser, all the displays is the file code. How do I get it to run just the file?

The Little Guy
06-22-2005, 01:43 PM
I right clicked an .asp file and selected "open with"
FireFox. it changed all of my .asp files to FireFox Icons icons.
I would liketo change them back, but
when I go back into "open with" I am unable to
select it as an "unknown application".

The Little Guy
06-22-2005, 01:50 PM
When I View this in my browser here is what I see how can I fix this?

<% Option Explicit %>
<!--#include file="common.inc" -->
<%
'****************************************************************************************
'** Copyright Notice
'**
'** Web Wiz Guide Internet Search Engine
'**
'** Copyright 2001-2002 Bruce Corkhill All Rights Reserved.
'**
'** This program is free software; you can modify (at your own risk) any part of it
'** under the terms of the License that accompanies this software and use it both
'** privately and commercially.
'**
'** All copyright notices must remain in tacked in the scripts and the
'** outputted HTML.
'**
'** You may use parts of this program in your own private work, but you may NOT
'** redistribute, repackage, or sell the whole or any part of this program even
'** if it is modified or reverse engineered in whole or in part without express
'** permission from the author.
'**
'** You may not pass the whole or any part of this application off as your own work.
'**
'** All links to Web Wiz Guide and powered by logo's must remain unchanged and in place
'** and must remain visible when the pages are viewed unless permission is first granted
'** by the copyright holder.
'**
'** This program is distributed in the hope that it will be useful,
'** but WITHOUT ANY WARRANTY; without even the implied warranty of
'** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR ANY OTHER
'** WARRANTIES WHETHER EXPRESSED OR IMPLIED.
'**
'** You should have received a copy of the License along with this program;
'** if not, write to:- Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom.
'**
'**
'** No official support is available for this program but you may post support questions at: -
'** http://www.webwizguide.info/forum
'**
'** Support questions are NOT answered by e-mail ever!
'**
'** For correspondence or non support questions contact: -
'** info@webwizguide.com
'**
'** or at: -
'**
'** Web Wiz Guide, PO Box 4982, Bournemouth, BH8 8XP, United Kingdom
'**
'****************************************************************************************



Response.Buffer = True

'Dimension variables
Dim rsSearchResults 'database Recordset Variable
Dim intRecordPositionPageNum 'Holds the record position
Dim intRecordLoopCounter 'Loop counter for displaying the database records
Dim lngTotalRecordsFound 'Holds the total number of records in the database
Dim lngTotalNumPages 'holds the total number of pages in the database
Dim intLinkPageNum 'Holds the page number to be linked to
Dim intLoopCounter 'Holds the loop counter number
Dim sarySearchWord 'Holds the keywords for the URL
Dim strSearchKeywords 'Holds the keywords to be searched
Dim intSQLLoopCounter 'Loop counter for the loop for the sql query
Dim intSearchWordLength 'Holds the length of the word to be searched
Dim blnSearchWordLenthOK 'Boolean set to false if the search word length is not OK
Dim intRecordDisplayFrom 'Holds the number of the search result that the page is displayed from
Dim intRecordDisplayedTo 'Holds the number of the search result that the page is displayed to


'If this is the first time the page is displayed then the page position is set to page 1
If Request.QueryString("PagePosition") = "" Then
intRecordPositionPageNum = 1

'Else the page has been displayed before so the page postion is set to the Record Position number
Else
intRecordPositionPageNum = CInt(Request.QueryString("PagePosition"))
End If


'Read in all the search words into one variable
strSearchKeywords = Trim(Request.QueryString("search"))

'If the use has not entered a value then let the search words variable contain a space (chr10)
If strSearchKeywords = "" Then strSearchKeywords = chr(10)

'Replace any less than or greater than signs with the HTML equivalent (stops people entering HTML tags)
strSearchKeywords = Replace(strSearchKeywords, "<", "&lt;")
strSearchKeywords = Replace(strSearchKeywords, ">", "&gt;")
strSearchKeywords = Replace(strSearchKeywords, "'", "''")

'Read in the search words to be searched
sarySearchWord = Split(Trim(strSearchKeywords), " ")

'Return the tow '' back to one' for displaying on the screen
strSearchKeywords = Replace(strSearchKeywords, "''", "'")


'Initalise the word search length variable
blnSearchWordLenthOK = True

'Loop round to check that each word to be searched has more than the minimum word length to be searched
For intLoopCounter = 0 To UBound(sarySearchWord)

'Initialise the intSearchWordLength variable with the length of the word to be searched
intSearchWordLength = Len(sarySearchWord(intLoopCounter))

'If the word length to be searched is less than or equal to min word length then set the blnWordLegthOK to false
If intSearchWordLength <= intMinuiumSearchWordLength Then
blnSearchWordLenthOK = False
End If
Next


'Create a recordset object
Set rsSearchResults = Server.CreateObject("ADODB.Recordset")


'Initalise the strSQL variable with an SQL statement to query the database
strSQL = "SELECT tblWebsites.* FROM tblWebsites "

'Get the mode to decide how we are going to buid the SQL Query
Select Case Request.QueryString("mode")

'If the user has selected to search any words then intalise the strSQL statement to search for any words in the database
Case "anywords"

'Search for the first search word in the URL titles
strSQL = strSQL & "WHERE Title LIKE '%" & sarySearchWord(0) & "%'"

'Loop to search for each search word entered by the user
For intSQLLoopCounter = 0 To UBound(sarySearchWord)
strSQL = strSQL & " OR Title LIKE '%" & sarySearchWord(intSQLLoopCounter) & "%'"
strSQL = strSQL & " OR Keywords LIKE '%" & sarySearchWord(intSQLLoopCounter) & "%'"
strSQL = strSQL & " OR Description LIKE '%" & sarySearchWord(intSQLLoopCounter) & "%'"
Next

'Order the search results by the number of click through hits decending (most popular sites first)
strSQL = strSQL & " ORDER By Rating DESC, No_of_ratings DESC, Hits DESC;"


'If the user has selected to search for all words then intalise the strSQL statement to search for entries containing all the search words
Case "allwords"

'Search for the first word in the URL titles
strSQL = strSQL & "WHERE (Title LIKE '%" & sarySearchWord(0) & "%'"


Etc. etc. There is more to the code, but you get the gist of it.

silverbullet24
06-22-2005, 04:02 PM
asp pages need to be run from IIS server. either upload them to a website running on windows server or install PWS on your own computer and put them into the local site. you can't just "open with" using IE of firefox and see the page output

rrhodes
06-23-2005, 08:09 AM
Your web host has not enabled ASP in your web site. Ask your web host to enable ASP. Make sure you are on a Microsoft server running windows ASP if you plan on doing any advanced programming (as opposed to the ASP they run on Unix).