Internet is growing Every Seconds :: Industry is growing Every Year

Tuesday, March 15, 2005

ASP Function : Get Submited value

Description :

Following Procedure used to display a Posted Data.


ASP Code :

'----To get Submited value from previous page
sub get_Submited_value()
for each item in Request.Form
Response.Write item &" : "& Request.Form(item)
Response.Write (" < br > ")
next
end sub

Friday, March 04, 2005

ASP Function : writeLog

Description :
This function used to trap the visitors IP address and Visited file.
this will write the user IP address and Visited files in one text
file (named nb_log.txt).
Session variables are assigned at login time.



ASP Code :

Function writeLog(line)
Dim FSO, myFile
set FSO = Server.CreateObject("scripting.FileSystemObject")
set myFile = fso.OpenTextFile("C:\Inetpub\wwwroot\nb_log.txt", 8,
true)
myFile.WriteLine(line)
myFile.Close
End function



Dim tmpFileName, fileName, line
tmpFileName = Split(Request.ServerVariables("URL"), "/")
fileName = tmpFileName(UBound(tmpFileName))
line = "UID: "& Session("User_ID")
line = line &", FName: "& fileName
line = line &", FPath: "& Session("nb_p_path")
line = line &", DT: "& Now()
line = line &", IP: "& Request.ServerVariables("REMOTE_ADDR")
line = line &", Agent: "& Request.ServerVariables("HTTP_USER_AGENT")
line = line &", Local Address: "& Request.ServerVariables("LOCAL_ADDR")

Call writeLog(line) ' calling the Function