%
dim zipfile, level_id, ftpserver, tiggCON, tiggRS
'zipfile is the file to retrive
zipfile = Request.QueryString("zip")
'level_id is the map id in db
level_id = Request.QueryString("id")
'how did they want to get the file?
ftpserver = Request.QueryString("ftp")
set tiggCON = Server.CreateObject("ADODB.Connection")
tiggCON.Open(DSN)
'does and entry exist in the DataBase?
query = "SELECT num_dload " & _
"FROM q3a_download " & _
"WHERE level_id = '" & level_id & "'"
'Response.Write("query(count)=[" & query & "]
")
set tiggRS = tiggCON.Execute(query)
if tiggRS.EOF then
'must be a new map or 1st d/load
query = "INSERT into q3a_download (level_id, num_dload, datestamp)" & _
"values (" & level_id & ", 1, getdate()) "
tiggCON.Execute(query)
else
'ok, there must already be a record
'tmp_count = tiggRS("num_dload")
'Response.Write("to date d/loads = [" & tmp_count & "]
")
query = "update q3a_download set num_dload = " & (cint(tiggRS("num_dload")) + 1) & ", datestamp = getdate()" & _
"where level_id = " & level_id
tiggCON.Execute(query)
end if
tiggRS.Close
tiggCON.Close
if ftpserver = "au" then
'ftp.cdrom mirror
Response.Redirect(au & file_dir(zipfile) & "/" & zipfile & ".zip")
else
'fileplanet
Response.Redirect(fileplanet & file_dir(zipfile) & "/" & zipfile & ".zip")
end if
%>