Yeah guys thanks for that I will give you the rest of the code so you
can see in proper light..sorry should have done that first.. :)


'Configuration Settings
VERSION         = "2.0"
WEBSITE_ID     = "1234"
AT_SERVER      = "www.mysite.com"
COOKIE_EXPIRES = 3

'Create a new client cookie
CC = new_cc()

'Store the cookie on client's machine
bake_cookie(CC)


HTTP_PROTOCOL = "http"
if ( Request.ServerVariables( "HTTPS" ) = "ON" ) then
  HTTP_PROTOCOL = "https"
end if

Response.Redirect( HTTP_PROTOCOL & "://" & AT_SERVER & "/" &
WEBSITE_ID & "/track/visit/?CC_" & VERSION & "=" &
Server.URLEncode(CC))

'SUBROUTINES

'Create a CC from scratch
function new_cc ()
  dim CC(6,2)
  CC(0,0) = "QUERY_STRING"
  CC(1,0) = "COOKIE_EXPIRES"
  CC(2,0) = "HTTP_REFERER"
  CC(3,0) = "SCRIPT_NAME"
  CC(4,0) = "SERVER_NAME"
  CC(5,0) = "PATH_INFO"

  CC(0,1) = Request.QueryString
  CC(1,1) = COOKIE_EXPIRES

  for i = 2 to 5
    CC(i,1) = Request.ServerVariables(CC(i,0))
  next

  new_cc = hash_to_string(CC)
end function

'receives a multi-dim array
'returns the CC string
function hash_to_string(CC)
  dim CC_string

  for i = 0 to 5
    if (CC(i,1) > "") then
      CC_string = CC_string & CC(i,0) & "=" & Server.URLEncode( CC(i,1) ) & "&"
    end if
  next
  hash_to_string = CC_string
end function

function bake_cookie (cookievalue)
  Response.Cookies("CC_" & VERSION) = cookievalue
  Response.Cookies("CC_" & VERSION).path = "/"
  Response.Cookies("CC_" & VERSION).expires = dateadd("yyyy",COOKIE_EXPIRES,now)
end function


Thanks


====================================
Postal: Po Box 3462 Dural, NSW 2158
Email: mailto:[EMAIL PROTECTED] 
FireFly Internet Phone: 80011777

---
You are currently subscribed to cfaussie as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to