<%@ Language =JScript EnableSessionState = False%> <% /**************************************************************************** Module: otl.asp Version 1.0 Description: Outgoing Traffic Logger. Logs outgoing hits in OTHits table of the Traffic Tracker database. Copyright (c) 2002, K&L Design Productions, All Rights Reserved. You may not use the code contained in this file without the express written permission of K&L Productions. You may not redistribute, sell, or offer this file for download, in any form or on any medium, without the express written permission of K&L Productions. This includes, but is not limited to, adding it to script archives or bundling and distributing it with other scripts/software. You agree to retain the credits and copyright notice in the source code when including it in your own pages. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHOR OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************************/ Response.Buffer = true; Response.Expires = 0; /* The sstart variable defined below is used for timing the script execution. Uncomment the following line during testing phase */ //var sstart = new Date(); /* Function: makeTTUID Creates a unique identifier based on the current time */ function makeTTUID() { dt = new Date(); uid = dt.getTime(); return uid; } /* --- START: Database configuration --- */ var dbLoc = 'TT/Data/TT.mdb'; // Relative path to the database file var strConn = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=' + Server.MapPath(dbLoc); /* --- END: Database configuration --- */ var target = Request.QueryString('Target'); var DB_Conn = Server.CreateObject('ADODB.Connection'); DB_Conn.Errors.Clear(); DB_Conn.Open(strConn); var rs = Server.CreateObject('ADODB.Recordset'); var strSQL = 'SELECT OTHits.* FROM OTHits ;'; rs.Open(strSQL,DB_Conn,3,3); rs.AddNew(); rs('DateTime') = getDate(); var userID = new String(Request.Cookies('TTUID')); var userOR = new String(Request.Cookies('TTUOR')); if(userID.length == 0) { userID = makeTTUID(); setCookie('TTUID',userID); } if(userOR.length>0) { rs('ClientReferrer') = userOR; } rs('UserID')= userID; rs('Target') = target; rs('Origin') = Request.ServerVariables('HTTP_REFERER'); rs('ClientIP') = Request.ServerVariables('REMOTE_ADDR'); rs.Update(); rs.Close(); DB_Conn.Close(); /* Following segment is used for timing the script execution. Uncomment the following three lines during the testing phase */ //var sfinish = new Date(); //etime = sfinish.getTime() - sstart.getTime(); //debout(' ->OTT.asp<- Script execution time: ' + etime + ' ms'); Response.Redirect(target); %>