Issue: Update a tracker database with an index.html file.

I have a user that needs to track hits for there site and he has to use 
an index.html file. Normally I use basic CF code that get the users 
information like below and that would insert into my DB. I need to 
figure out a way to get this information and have it happen 
transparently from the user.

Right now I have a basic script in the body tag that opens a CF page 
that grabs the users information and closes quickly. I want to know if 
there is a way to call a CF page and not have it open so I can grab the 
info I need when the user hits the home page.

What's in the index.html file:

<BODY BGCOLOR="#FFFFFF" LEFTMARGIN="0" TOPMARGIN="0" MARGINWIDTH="0"
MARGINHEIGHT="0"
aLink=#ff0000 link=#0033CC vLink=#0033CC
Onload="window.open('SiteLog.cfm','jav','menubar=no,toolbar=no,scrollbars=no,width=5,height=5,resizable=yes');"
 
background="background/background.gif">

When the script page loads I grab the users information insert into my 
DB and run <body onLoad="setTimeout(window.close, 1)">.

Can anyone think of a better way of doing this so if the user has a slow 
connection they wont see a glimpse of the window I open and close?

Sincerely,
James Blaha

<CFQUERY NAME="TrafficLog" DATASOURCE="Stats">

insert into siteTracker

( datetimestamp,
referrer,
client_address,
client_host,
client_browser,
resource,tracker_id
)

values
( getdate(),

<CFIF #left(cgi.http_referer,128)# neq "">
'#left(cgi.http_referer,128)#'
<CFELSE>
NULL
</CFIF>,

<CFIF #left(cgi.remote_addr,128)# neq "">
'#left(cgi.remote_addr,128)#'
<CFELSE>
NULL
</CFIF>,

<CFIF #left(cgi.http_host,128)# neq "">
'#left(cgi.http_host,128)#'
<CFELSE>
NULL
</CFIF>,

<CFIF #left(cgi.http_user_agent,128)# neq "">
'#left(cgi.http_user_agent,128)#'
<CFELSE>
NULL
</CFIF>,

<CFIF #left(cgi.script_name,128)# neq "">
'#left(cgi.script_name,128)#'
<CFELSE>
NULL
</CFIF>,

<CFIF #val(attributes.tracker_id)# neq "">
'#val(attributes.tracker_id)#'
<CFELSE>
NULL
</CFIF>
)


</CFQUERY>


______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to