<%@ Language=VBScript %> <%'grab the ID from the cookie, or determine what it is UserID=Request.Cookies("HealthyWealthynWise")("ID") If UserID="" OR IsNull(UserID) Then'go grab the ID username=Request.Cookies("HealthyWealthynWise")("username") password=Request.Cookies("HealthyWealthynWise")("password") fname=Request.Cookies("HealthyWealthynWise")("fname") IDRS=Connect.Execute("Select ID From TblMembers Where UserName='"&username&"' AND password='"&password&"' AND fname='"&fname&"'") 'go ahead and set the cookie Response.Cookies("HealthyWealthynWise")("ID")=IDRS("ID") Response.Cookies("HealthyWealthynWise")("username")=username Response.Cookies("HealthyWealthynWise")("password")=password Response.Cookies("HealthyWealthynWise")("fname")=fname Response.Cookies("HealthyWealthynWise").Expires = #January 01, 2010# UserID=IDRS("ID") Set IDRS=nothing End IF'end test for empty ID in cookie 'Grab the requested link from the querystring 'need to grab EVERYTHING AFTER THE 'url' tag 'urllink=request.servervariables("Query_String") 'Response.Write "Here's the Query-String server var: "&urllink&"
" url=trim(request.servervariables("Query_String")) 'get rid of the 'url=' at the beginning of the string url=Right(url,(len(url)-4)) 'add it to the db with the userID doing the clicking 'Now to hit the DB Dateadded=Year(Now())&"-"&Month(Now())&"-"&Day(Now()) SQL="Insert Into TblLinkHits (MemberID,Link,DateAdded) Values ("&UserID&",'"&url&"','"&DateAdded&"')" Connect.Execute (SQL) 'then redirect the user Response.Redirect url 'Response.Write url %>