jacko310592 Posted January 21, 2010 Share Posted January 21, 2010 hey guys, is there anyway in which i can identify my PC using PHP so that i can exclude myself from my log files on my website when testing. i have a Dynamic IP address therefore i cannot use that to identify it. thanks Quote Link to comment https://forums.phpfreaks.com/topic/189325-identifying-own-pc-to-exclude-from-log-file/ Share on other sites More sharing options...
salathe Posted January 21, 2010 Share Posted January 21, 2010 How variant is your IP address; how often are there other log entries containing an IP that you have used but is not you? Quote Link to comment https://forums.phpfreaks.com/topic/189325-identifying-own-pc-to-exclude-from-log-file/#findComment-999430 Share on other sites More sharing options...
jacko310592 Posted January 21, 2010 Author Share Posted January 21, 2010 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? Quote Link to comment https://forums.phpfreaks.com/topic/189325-identifying-own-pc-to-exclude-from-log-file/#findComment-999434 Share on other sites More sharing options...
otuatail Posted January 21, 2010 Share Posted January 21, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/189325-identifying-own-pc-to-exclude-from-log-file/#findComment-999439 Share on other sites More sharing options...
jacko310592 Posted January 21, 2010 Author Share Posted January 21, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/189325-identifying-own-pc-to-exclude-from-log-file/#findComment-999443 Share on other sites More sharing options...
otuatail Posted January 21, 2010 Share Posted January 21, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/189325-identifying-own-pc-to-exclude-from-log-file/#findComment-999449 Share on other sites More sharing options...
jacko310592 Posted January 21, 2010 Author Share Posted January 21, 2010 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 Quote Link to comment https://forums.phpfreaks.com/topic/189325-identifying-own-pc-to-exclude-from-log-file/#findComment-999458 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.