Jump to content

Identifying own PC to exclude from log file


jacko310592

Recommended Posts

well my IP seems to completly change most days (every time my router is reset); and i havnt ever seen anyone with the same IP as one which i have had in a log

 

 

could this code be used

gethostbyaddr($_SERVER['REMOTE_ADDR'])

when i tested it on my local host, it gave my PC name, is this what i would also get once it was added to the site online?

I did this once. I got a seperate webpage to capture my IP address and if the IP address on the page matched it skiped it. It worked fine.

 

Ehat I do now is i type in something like

www.mywebsite.co.uk?itsME=Yes

 

if ($_GET['itsME'])

  $_SESSION["NoLog = "True"];

 

Just keep looking for that session variable.

 

Desmond.

 

thanks for the suggestion Desmond, that way may be a little tricky to impliment with my pages though as i already use sessions on some pages and rewritten URLs, so it would take quite a bit of re-coding.

 

thanks again for the post though

If you have a lot of pages that need changing it would. my site has to go through a home page so the session is allways set. You could do as I sugest, have a private page that does nothing only capture the IP address and save it as a session. if you are using a seperate code page for functions that for example log info into a database then you would only need to check this session in a single file. Don't know how you have set things up but a general functions page gives it a bit of OOP

 

Desmond

 

with me having a Dynamic IP, doing what you suggested wouldnt always work as my IP may change at times,  but i could go with a page for creating a session based on the url like you said in your previous post  (sorry if thats what you where getting at in the first place, i just re-read your previous post, dont think i read i correctly first time)

 

thanks again Desmond

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.