/    Sign up×
Community /Pin to ProfileBookmark

Grabbing User’s Original IP, Os, Web browser, Isp

Php Folks,

  • 1.

    May I see your code that you use to grab your website visitor’s real ip, real isp, real os (and not vmware and the like), real web browser,  ? It should grab the real ones and not the proxy’s ones or the company router’s ones or the the private/public VPN ones they are using.

  • 2.

    Also, I’d like to see what code you use to get your script to detect whether the visitor is behind a proxy or not. Because, if he using proxy then I want to forward him to a different page like a fake signup page.

  • 3.

    And is there any way in php to only give the user access to his “home.php” after “login.php” checks and finds the user is using the same computer to login that he used to sign up ? You see, I do not want the user signing up using one computer and then using my website (his member account) using another computer. So, if you signup to me using an internet cafe public computer then you should not be able to login to your account using your home computer. That is the big idea. Now, how would you code this one ? May I see a sample code ?

  • I have no clue where to start with these 3 codes.

    I just checked-out these tutorials and I have doubts whether the codes would do what I want regarding grabbing the user’s real ip:

    https://www.codexworld.com/how-to/get-user-ip-address-php/

    https://www.virendrachandak.com/techtalk/getting-real-client-ip-address-in-php-2/

    As for the following link, it seems the professional php guys are fighting over who’s code is perfect and who’s not:

    https://stackoverflow.com/questions/13646690/how-to-get-real-ip-from-visitor

    And so, according to you which code I should learn from ? Or maybe, you have a better link that teaches me how to do what I want ? If so, then by all means be my guest and point me to that link.

    Thanks!

    to post a comment
    PHP

    9 Comments(s)

    Copy linkTweet thisAlerts:
    @GgosyNov 07.2018 — Thanks fot idea
    Copy linkTweet thisAlerts:
    @headgazNov 08.2018 — Read books on this topic or watch the training videos, now there are a lot of free and accessible information on the Internet
    Copy linkTweet thisAlerts:
    @MlrtcvklNov 08.2018 — Nice hacker
    Copy linkTweet thisAlerts:
    @oleg1972Nov 08.2018 — Search YouTube
    Copy linkTweet thisAlerts:
    @rootNov 09.2018 — $user_ip = $_SERVER['REMOTE_ADDR'];
    Copy linkTweet thisAlerts:
    @hrikuNov 13.2018 — All the best is here http://php.net/manual/en/reserved.variables.server.php
    Copy linkTweet thisAlerts:
    @LomSomNov 18.2018 — Is it necessary to collect IPs and other data when lots of people use nowadays different vpns *no urls to unrelated sites please*, proxies, and other tools that hide your stuff and let bypass restrictions?
    Copy linkTweet thisAlerts:
    @PeterPan_321Nov 20.2018 — What Root suggested ($user_ip = $_SERVER['REMOTE_ADDR']? is a good start. You can also ask for their email address on a form, test the domain in the email they are expecting to be contacted at.

    // see if email domain is legitamate. Make sure email is properly structured first!// returns error string, or empty string if all is well

    function testDomain($email) {

    $error = "";

    $domain = substr($email, stripos($email, "@") + 1); // recover just domain

    // Get the IV4 address. It returns the original string on failure,
    // so if the first char is a digit, its probably a good domain.
    $ivp = gethostbyname($domain);
    $firstChar = substr($ivp, 0, 1);
    if (!is_numeric($firstChar)) $error = $domain . " doesnt exist";
    return $error;

    }

    but a lot of the other stuff you're asking for is going to be pretty tough to gather. Especially considering (as other have mentioned), the people who don't volunteer accurate information are likely the ones who are experts in hiding.

    Its possible that once you have the IVP IP address though, you could append it to the end of https://myip.ms/info/whois/ and send the http request, and parse the information on the page it presents (myip.ms might even have a paid service that presents all the data in a a friendly way, that doesn't require a lot of page scraping. I've used that site to check IP addresses of suspicious emails for years, and sure enough most of the problem emails point to Russia! :-)
    Copy linkTweet thisAlerts:
    @rootNov 20.2018 — Suggest you look in to GDPR and the wider international implications of recording users IP addresses.
    ×

    Success!

    Help @site-developer spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 4.25,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,

    tipper: @Samric24,
    tipped: article
    amount: 1000 SATS,
    )...