%
Dim adoCon 'Database Connection Variable
Dim rsConfiguration 'Holds the configuartion recordset
Dim strCon 'Holds the Database driver and the path and name of the database
Dim strSQL 'Holds the SQL query for the database
Dim intRecordsPerPage 'Holds the number of files shown on each page
Dim strBgColour 'Holds the background colour
Dim strTextColour 'Holds the text colour
Dim strTextType 'Holds the font type
Dim intTextSize 'Holds the font size
Dim strLinkColour 'Holds the link colour
Dim strTableColour 'Holds the table colour
Dim strTableBorderColour 'Holds the table border colour
Dim strVisitedLinkColour 'Holds the visited link colour
Dim strHoverLinkColour 'Holds the mouse over link colour
'Declare constants
' ----------------- Change the following line to the number of entries you wish to have on each page and miniumum word length ------------------------
Const intMinuiumSearchWordLength = 2 'Change this to the minimum word length to be searched on
'-------------------------------------------------------------------------------------------------------------------------------------
'Create database connection
'Create a connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
'------------- If you are having problems with the script then try using a diffrent driver or DSN by editing the lines below --------------
'Database connection info and driver (if this driver does not work then comment it out and use one of the alternative drivers)
'strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("../private/search_engine.mdb")
'Database driver for Brinkster
'strCon = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("/USERNAME/db/search_engine.mdb") 'This one is for Brinkster users place your Brinster username where you see USERNAME
'Alternative drivers faster than the basic one above
'strCon = "Provider=Microsoft.Jet.OLEDB.3.51; Data Source=" & Server.MapPath("search_engine.mdb") 'This one is if you convert the database to Access 97
'USE THIS STRING FOR LOCAL DEVELOPMENT ACCESS 2000 VERSION
'=========================================================
'strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("../../private/search_engine.mdb") 'This one is for Access 2000/2002
'USE THIS STRING FOR LIVE SITE ACCESS 2000 VERSION
'=================================================
'strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("./../private/search_engine.mdb") 'This one is for Access 2000/2002
'If you wish to use DSN then comment out the driver above and uncomment the line below (DSN is slower than the above drivers)
'strCon = "Provider=Microsoft.Jet.OLEDB.4.0; DRIVER={MySQL}; DSN=the-search-site" 'This one is for Access 2000/2002
'strCon = "DSN=the-search-site"
'USE THIS STRING FOR LOCAL DEVELOPMENT ACCESS 2000 VERSION
'=========================================================
'strCon = "Driver={MySQL ODBC 3.51 Driver}; Server=localhost; Database=search_engine; Option=4; User=MyUserName; Password=MyPassword;"
'strCon = "Driver={MySQL ODBC 3.51 Driver}; Server=localhost; Database=search_engine; Option=4;"
'USE THIS STRING FOR LOCAL SITE MySQL 2000 VERSION
'=================================================
'strCon = "Driver={MySQL ODBC 3.51 Driver}; Server=127.0.0.1; Port=3306; Database=search_engine; Option=4;" 'Uid=MyUsername;Pwd=MyPassword;
'USE THIS STRING FOR LIVE SITE MySQL 2000 VERSION
'================================================
strCon = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=mikeadmin.db.2238098.hostedresource.com; PORT=3306; DATABASE=mikeadmin; USER=mikeadmin; PASSWORD='Freddy111'; OPTION=0;"
'---------------------------------------------------------------------------------------------------------------------------------------------
'Set an active connection to the Connection object
adoCon.Open strCon
intRecordsPerPage = 14
strBgColour = "#FFFFFF"
strTextColour = "#000000"
strTextType = "Verdana, Arial, Helvetica, sans-serif"
intTextSize = 11
strLinkColour = "#0000CC"
strTableColour = "#CCCCCC"
strTableBorderColour = "#000000"
strVisitedLinkColour = "#0000CC"
strHoverLinkColour = "#FF0000"
%>
<%
'---- BodyFormat Property ----
Const CdoBodyFormatHTML = 0 ' The Body property is to include Hypertext Markup Language (HTML).
Const CdoBodyFormatText = 1 ' The Body property is to be exclusively in plain text (default value).
'---- MailFormat Property ----
Const CdoMailFormatMime = 0 ' The NewMail object is to be in MIME format.
Const CdoMailFormatText = 1 ' The NewMail object is to be in uninterrupted plain text (default value).
'---- Importance Property ----
Const CdoLow = 0 ' Low importance
Const CdoNormal = 1 ' Normal importance (default)
Const CdoHigh = 2 ' High importance
'---- AttachFile and AttachURL Methods ----
Const CdoEncodingUUencode = 0 ' The attachment is to be in UUEncode format (default).
Const CdoEncodingBase64 = 1 ' The attachment is to be in base 64 format.
MyEnquiry = Request("enquiry")
'remove any HTML tags
MyEnquiry = Replace(MyEnquiry, "<", "<")
MyEnquiry = Replace(MyEnquiry, ">", ">")
MyEnquiry = Replace(MyEnquiry, "'", "`")
MyEnquiry = Replace(MyEnquiry, """", "`")
If Request("name") <> "" Then
strBrowserID = Request.ServerVariables("REMOTE_HOST")
Dim objNewMail
Dim strBody
strBody = "NAME: " & Request("name") & "
"
strBody = strBody & "EMAIL: " & Request("email") & "
"
strBody = strBody & "COMPANY: " & Request("company") & "
"
strBody = strBody & "DEPARTMENT: " & Request("dept") & "
"
strBody = strBody & "COUNTRY: " & Request("country") & "
"
strBody = strBody & "SALES ORDER: " & Request("order") & "
"
strBody = strBody & "COMPUTER I.P.: " & strBrowserID & "
"
strBody = strBody & "
" & Request("enquiry")
Set objNewMail = Server.CreateObject("CDONTS.NewMail")
objNewMail.From = Request("email")
objNewMail.To = Request("nature") & "@the-search-site.com"
objNewMail.Subject = Request("nature") & " enquiry to the-search-site.com"
objNewMail.Body = strBody
objNewMail.BodyFormat = CdoBodyFormatHTML
objNewMail.MailFormat = CdoMailFormatText
objNewMail.Importance = CdoNormal
objNewMail.Send
Set objNewMail = Nothing
End If
%>
<% If strBrowserID <> "" Then %> Thank you for your enquiry, this has been sent to our team. Please note that in the interests of security your computer id has been logged (<%=strBrowserID%>) <% End If %>
www.the-search-site.com Tel: 09063 020 888 (UK enquiries only) |