<% '' increment the download counter. if FileURL is passed the user will be redirected to this URL, otherwise the database is '' queried for the value stored in DownloadURL and the user is redirected to DownloadURL ContentId = request("ContentId") FileURL = request("FileURL") if ContentId <> "" then set rs = cn.Execute ("SELECT DownloadURL, Downloads FROM Content WHERE ContentId = " & ContentId) DownloadURL = rs("DownloadURL") Downloads = rs("Downloads") if not IsNull(Downloads) then Downloads = Downloads + 1 else Downloads = 1 end if rs.Close ''' increment the downloads cn.Execute ("UPDATE Content SET Downloads = " & Downloads & " WHERE ContentId = " & ContentId) if FileURL = "" then response.redirect DownloadURL else response.redirect FileURL end if end if %> <% dim dummy do_search = request("do_search") ':: handle the default case(s) for each form (separate from action= parameter) %> <% display_errs display_msg %> <% ':: assure that any db resources are freed on error resume next rs.Close set rs = NOTHING cn.Close set cn = NOTHING user_cn.Close set user_cn = NOTHING on error goto 0 %>