Home Forum Download/Upload Links Search

NetTalk User Group

NetTalk User Group Meeting!
Live Webinar!
Saturday Nov. 16 
7am PST
Click Here To Register!
NetTalk Central
September 18, 2014, 09:45:52 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to the NetTalk Central Forums!
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: track incoming IP address  (Read 2621 times)
kevin plummer
Hero Member
*****
Posts: 982



View Profile WWW
« on: July 30, 2008, 12:03:46 PM »

Is there any way to track the incoming IP address?

I need to keep a log of activity of what users are inserting, changing or deleting records but would also like to track the IP address for the auditors as well to help (I know it's not fool proof) prove that someone was not just logging in with someone else's login.

Any other ideas?

Cheers,

Kevin
Logged
Mike Grigsby
Sr. Member
****
Posts: 380


onthedotsoftware
View Profile WWW
« Reply #1 on: July 30, 2008, 12:17:08 PM »

Yup, that would be: p_web.RequestData.FromIP

Also handy:

p_web.WholeURL     
p_web.RequestFileName
p_web.RequestReferer

I use these to track my own sort of log file on my website. I use an inline page call to a program I wrote in NetTalk that does nothing but track this data into a log. The entirety of my procedure's code is in a NetWebPage proc called HitLogger. In the procedure setup I have the code:

   OPEN(WebLog,ReadWrite+DenyNone)
   WEB:SysID=Today() & Clock()
   WEB:HitDate=Today()
   WEB:HitTime=Clock()
   WEB:HitPage=p_web.WholeURL     
   WEB:PageName=p_web.RequestFileName
   WEB:Referrer=p_web.RequestReferer
   WEB:ClientIP=p_web.RequestData.FromIP
   ADD(WebLog)
   CLOSE(WebLog)
Logged

Mike Grigsby
Credify Systems
Central Oregon, USA
AlanTelford
Jr. Member
**
Posts: 76


View Profile
« Reply #2 on: July 30, 2008, 04:35:18 PM »

Can you elaborate on how you do the inline page call.
i.e. when/where do you call your hitlogger() procedure?

Thanks
Logged
Mike Grigsby
Sr. Member
****
Posts: 380


onthedotsoftware
View Profile WWW
« Reply #3 on: July 30, 2008, 05:43:44 PM »

Sure. First, the HitLogger proc has no text and no headers or footers. It's just a page with the same color as the web page it is meant to display on. You can see (or not see<g>), my website at hrsnap.com and view the source, but this is the code (I included the cell code just to give it context):

 <td colspan="2" width="12"><iframe id="InlineFrame4" name="InlineFrame2" src="http://216.228.174.169:89/HitLogger" width="12" height="9" frameborder="0"></iframe></td>

Everytime the web page is loaded, the HitLogger is automatically called and it basically just logs their info. So along with the RequestFileName and RequestReferer that I mentioned, I can track the progress of the visitor through my website. Someday I'll figure out how to make a tracert proc for NetTalk to find out the URL of the associated IP address.

I have a program I run that does nothing but handle the forms, requests, logging, etc. for my website. So what I end up with is a log per the attached image.
« Last Edit: July 30, 2008, 05:49:41 PM by Mike Grigsby » Logged

Mike Grigsby
Credify Systems
Central Oregon, USA
AlanTelford
Jr. Member
**
Posts: 76


View Profile
« Reply #4 on: July 31, 2008, 12:44:46 PM »

Thanks for sharing. That helps!

I'm slightly puzzled because it looks as if your "HITPAGE" is always going to be "HitLogger" and is therefore redundant (unless you have multiple hit logger procedures).
So I guess the real valuable part is the "RequestReferrer" which is always the page which calls the hitlogger.

I had a play and ending up putting the logging code into my "PageHeaderTag".
So, any pages which use the common header will automatically log their information.  This saved me from having to insert the code into my pages.

Thanks again for sharing. i'd been meaning to add some logging for a long time.
Logged
Mike Grigsby
Sr. Member
****
Posts: 380


onthedotsoftware
View Profile WWW
« Reply #5 on: July 31, 2008, 02:52:07 PM »

Alan, Yes, you're right, or course. This is a work in progress, and as I say, I'm just experimenting. Eventually I want to put the Tracert result on one of those columns. I was mainly trying to see what was returned from the NTW functions.
Logged

Mike Grigsby
Credify Systems
Central Oregon, USA
Mike Grigsby
Sr. Member
****
Posts: 380


onthedotsoftware
View Profile WWW
« Reply #6 on: July 31, 2008, 05:29:45 PM »

Actually, I have a correction. Hitlogger is not always the same if different pages use additional parameters. On the screen shot, they all show just HitLogger, which to me, indicates it is a hit to my home page.

On other pages, I call the inline frame by putting a parameter behind it, like 192.168.0.100/hitlogger?About_Page. Then th hitlogger entry is not the same. Sorry for the confusion. My screen shot didn't show that.
Logged

Mike Grigsby
Credify Systems
Central Oregon, USA
Bruce
Global Moderator
Hero Member
*****
Posts: 6941



View Profile
« Reply #7 on: August 01, 2008, 05:31:13 AM »

Hi Kevin,

Mikes explanation is great. I can add very little except to say;

you can get the IP of the current request using
p_web.GetSessionIP()
Thus anywhere you are currently logging stuff, you can add the IP number of the client to your log.

Cheers
Bruce
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
Joomla Bridge by JoomlaHacks.com
Valid XHTML 1.0! Valid CSS!

Login Form

Welcome Guest.






Lost Password?
No account yet? Register
home contact search contact search