| |
Ex-D
Posts: 1
Score: 0
Joined: 11/9/2001
From: United Kingdom
Status: offline
|
The download counter should: * Accept the download title(ID) from the URL * Record the server data and time for that download (and what file it was) * Redirect to the file. * Work on brinkster Here is what I have patched together (but it didn't work (I am a newbie to ASP (But not VB!)))... <%@ Language=VBScript %> <% 'Dim strURL As String 'Store the variable to name. txtnameadd is the text box in index.htm 'If you study the HTML code of it you will understand 'Request.form function request the value from the form. 'name = server.HtmlEncode(request.form("txtnameadd")) 'Create object. In this case Connection to a database Set Conn = Server.CreateObject("ADODB.Connection") 'Select provider Conn.Provider = "Microsoft.Jet.OLEDB.4.0" 'Select data source. 'Server.MapPath function is equivalent to app.path function of VB 'It returns the directory in which the script is present Conn.ConnectionString = "Data Source=" & Server.MapPath ("\exd\db\data.mdb") 'Open the connection Conn.Open Select Case request("title") Case "ComputerControl" strURL = "http://www.ex-d.net" Case "MouseWrap" strURL = "http://www.mural-ssigns.co.uk" End Select 'Create recordset Set Rs = Server.CreateObject("ADODB.Recordset") 'Open recordset with the connection which we have created earlier 'you must be familiar with SELECT statement , 'If not check my VB tutorial section. Rs.Open "SELECT * from users", Conn, 1,3 'Add a blank record Rs.addnew 'Store date to Rs(request("title")) = "testing" Rs.update 'Deinitialize the Connection and Recordset set Rs = nothing set Conn = nothing Response.Write "redirect to:" & strURL %>
|
|