Welcome to PDA Technology
Our
products
News
Purchasing
Buy Pda
Tech Products Online
We
use the Atlantic Coast Soft Shop (SWREG) secure server to handle
our online transactions. SWREG accepts Mastercard, Eurocard, VISA,
Delta, JCB, Switch, Solo, Discover, American Express, Diner's Club,
UK cheque, US check, Eurocheque, Postcheque, International Money
Order, Bank wire and PayPal.
If
you prefer to transmit your credit card number by FAX please follow
the procedure for an on-line purchase, but instead of entering your
credit card number checkmark the option FAX and you will be presented
with a page to print and fax to complete the order.
|
|
<%
'*******************************************************
'* ASP 101 Sample Code - http://www.asp101.com/ *
'* *
'* This code is made available as a service to our *
'* visitors and is provided strictly for the *
'* purpose of illustration. *
'* *
'* http://www.asp101.com/samples/license.asp *
'* *
'* Please direct all inquiries to webmaster@asp101.com *
'*******************************************************
%>
<%= RetrieveAndIncrementCount() %>
<%
' I placed this in a function so I wouldn't have to worry about
' any namespace collisions. For example... if this was inline
' code and someone named a variable strSQL in a file this file
' gets included into you'd get an error. This way you don't and
' there's no chance of the variables overwriting one another!
Function RetrieveAndIncrementCount()
' From adovbs.inc:
Const adOpenKeyset = 1
Const adLockPessimistic = 2
Const adCmdText = &H0001
' Local variables
Dim strFilename
Dim strSQL
Dim rsCounter
Dim iCount
Dim YCount
' Get filename and build SQL query
strFilename = Request.ServerVariables("SCRIPT_NAME")
strSQL = "SELECT page_name, hit_count FROM hit_count WHERE page_name='" & strFilename & "';"
' Open our recordset
Set rsCounter = Server.CreateObject("ADODB.Recordset")
rsCounter.Open strSQL, "DSN=mesnet_data",adOpenKeyset, adLockPessimistic, adCmdText
If rsCounter.EOF Then
rsCounter.AddNew
iCount = 0
rsCounter.Fields("page_name").Value = strFilename
Else
rsCounter.MoveFirst
iCount = rsCounter.Fields("hit_count").Value
End If
rsCounter.Fields("hit_count").Value = iCount + 1
rsCounter.Update
rsCounter.Close
Set rsCounter = Nothing
strFilename = FormatDateTime(Date, 2) & strFilename
strSQL = "SELECT page_name, hit_count FROM hit_count WHERE page_name='" & strFilename & "';"
Set rsCounter = Server.CreateObject("ADODB.Recordset")
rsCounter.Open strSQL, "DSN=mesnet_data",adOpenKeyset, adLockPessimistic, adCmdText
If rsCounter.EOF Then
rsCounter.AddNew
iCount = 0
rsCounter.Fields("page_name").Value = strFilename
Else
rsCounter.MoveFirst
iCount = rsCounter.Fields("hit_count").Value
End If
rsCounter.Fields("hit_count").Value = iCount + 1
rsCounter.Update
rsCounter.Close
Set rsCounter = Nothing
strFilename = "/ixMain.aspYalan"
strSQL = "SELECT page_name, hit_count FROM hit_count WHERE page_name='" & strFilename & "';"
Set rsCounter = Server.CreateObject("ADODB.Recordset")
rsCounter.Open strSQL, "DSN=mesnet_data",adOpenKeyset, adLockPessimistic, adCmdText
If rsCounter.EOF Then
rsCounter.AddNew
iCount = 23406
rsCounter.Fields("page_name").Value = strFilename
Else
rsCounter.MoveFirst
iCount = rsCounter.Fields("hit_count").Value
End If
YCount=timer
YCount=Clng(YCount)
YCount=YCount AND 15
IF Clng(YCount)<1 THEN YCount=1
rsCounter.Fields("hit_count").Value = iCount + YCount
rsCounter.Update
rsCounter.Close
Set rsCounter = Nothing
RetrieveAndIncrementCount = iCount
End Function
%>
|