473,379 Members | 1,257 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

IP Address detection

G
Hello,

For whatever reason, I want to get an email when my friends STATIC IP
ADDRESS clocks a visit on my site.

Will this work?: (Pretend his IP address is 80.112.144.244)

<%Session("IP")=Request.Servervariables("REMOTE_HO ST")%>
<% if Session("IP")="80.112.144.244" then "Sendmail" else "Do nothing" end
if%>

Or
<% if Request.Servervariables("REMOTE_HOST")="80.112.144 .244" then
"Sendmail" else "Do nothing" end if%>
Jul 19 '05 #1
3 1908
I would use REMOTE_ADDR rather than REMOTE_HOST. The purpose of REMOTE_HOST
is to store the host *name* not IP address, it just so happens that most
configurations don't support host name so IP is relayed instead.

You asked, "will this work?" Well, did you try it?

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"G" <no**********@here.com> wrote in message
news:c3*******************@news.demon.co.uk...
Hello,

For whatever reason, I want to get an email when my friends STATIC IP
ADDRESS clocks a visit on my site.

Will this work?: (Pretend his IP address is 80.112.144.244)

<%Session("IP")=Request.Servervariables("REMOTE_HO ST")%>
<% if Session("IP")="80.112.144.244" then "Sendmail" else "Do nothing" end
if%>

Or
<% if Request.Servervariables("REMOTE_HOST")="80.112.144 .244" then
"Sendmail" else "Do nothing" end if%>

Jul 19 '05 #2
Well, have you tried it? Should work fine, but make sure when you call your
E-mailing sub, you don't enclose the subroutine name is quotes as you have
below. Something like this should work:

global.asa:

<script language="vbscript" runat="server">

Sub Session_OnSTart()
If REquest.ServerVariables("REMOTE_HOST") = "80.112.144.244" Then Call
SendMeAnEmail()
End Sub

Sub SendMeAnEmail()
Dim oCDO
Set oCDO = CreateObject("CDO.Message")
oCDO.From = "yo*@yourdomain.kom"
oCDO.To = "yo*@yourdomain.koom"
oCDO.Subject = "My friend visited the site."
oCDO.TextBody = "Friend at site at " & Now()
oCDO.Send
Set oCDO = Nothing
End Sub
</script>

Ray at work
"G" <no**********@here.com> wrote in message
news:c3*******************@news.demon.co.uk...
Hello,

For whatever reason, I want to get an email when my friends STATIC IP
ADDRESS clocks a visit on my site.

Will this work?: (Pretend his IP address is 80.112.144.244)

<%Session("IP")=Request.Servervariables("REMOTE_HO ST")%>
<% if Session("IP")="80.112.144.244" then "Sendmail" else "Do nothing" end
if%>

Or
<% if Request.Servervariables("REMOTE_HOST")="80.112.144 .244" then
"Sendmail" else "Do nothing" end if%>

Jul 19 '05 #3
G

"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message
news:OO**************@TK2MSFTNGP10.phx.gbl...
I would use REMOTE_ADDR rather than REMOTE_HOST. The purpose of REMOTE_HOST is to store the host *name* not IP address, it just so happens that most
configurations don't support host name so IP is relayed instead.

You asked, "will this work?" Well, did you try it?

Nope didnt try.
Jul 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

60
by: Fotios | last post by:
Hi guys, I have put together a flexible client-side user agent detector (written in js). I thought that some of you may find it useful. Code is here: http://fotios.cc/software/ua_detect.htm ...
8
by: R. Smits | last post by:
I've have got this script, the only thing I want to be changed is the first part. It has to detect IE version 6 instead of just "Microsoft Internet Explorer". Can somebody help me out? I tried...
7
by: mosaic | last post by:
Hi, all I really interested in how to check the memory leak of a program. Your smart guys, do you have excellent ideas that could share with me? Thank you. The following is my idea: In C...
10
by: Conrad Lender | last post by:
In a recent thread in this group, I said that in some cases object detection and feature tests weren't sufficient in the development of cross-browser applications, and that there were situations...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.