Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Send email when a visitor comes to site 1

Status
Not open for further replies.

DrumAt5280

Technical User
Sep 8, 2003
194
0
0
US
I know the static IP address of a visitor I wish to track when he comes for a visit.

With Coldfusion can I:
- see if he visits by watching for his IP address?
- if he is visiting my site to send me an email?

Once i get the email i can go to my logs to see where he has been on the site.

Thanks
 
i would suggest creating a session for the user and tracking the user behaviour via the sessionId. you can do something like
<cfset UserSession = '#CLIENT.CFID#&#CLIENT.CFTOKEN#'>

the reason for this is some companies like AOL changes the ip address of the user from quite often. when person1 comes using AOL to your site his ip address may be 122.12.12.1. when the same user hits to another page on your site the user's ip address is now 205.12.25.56. Be aware of this.
you can look at the #CGI.HTTP_REFERER# and #CGI.SCRIPT_NAME# to tell where the user is and where the user comes from.
also, be aware that http_referer may be sometime null.

hope it helps..


 
You may try:

<cfif #CGI.REMOTE_ADDR# IS "205.12.25.56">
<cfmail to="me@me.com"
username="me@me.com"
password="mypassword"
from="me@me.com"
subject="Visitor Stopped By">
Visitor hit site.
</cfmail>
</cfif>

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top