Can anyone give me some direction on saving ASP login information to a SQL database. I have been trying for days to capture the login information from my site and do an INSERT INTO my SQL server.
Code:
Dim objConn
Dim strSQL1
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Driver={SQL Server};Server=servername\SQLEXPRESS;UID=username;PWD=password;Language=us_english;Database=testdb;DSN=;"
strSQL1 = "INSERT INTO site_activity ([user_name],[user_password],[ip_address]) VALUES " & _
"('" & Session("username") & "','" & _
Session("password") & "','" &_
Request.ServerVariables("REMOTE_ADDR") & "')"
objconn.execute strSQL1
the problem is I can not seem to capture the remote_addr? anyone know how to capture that with the request.servervariables("remote_addr")? thanks :)
EDIT: looks like im getting lucky i fixed this one also: I used the following code:
Code:
Dim objConn
Dim strSQL1
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "Driver={SQL Server};Server=computername\SQLEXPRESS;UID=username;PWD=password;Language=us_english;Database=testdb;"
strSQL1 = "INSERT INTO site_activity ([user_name],[user_password],[date],[ip_address]) VALUES " & _
"('" & Session("username") & "','" & _
Session("password") & "','" &_
now & "','" &_
Request.ServerVariables("REMOTE_HOST") & "')"
objconn.execute strSQL1
good day to all! :D