real ip address
A simple function to find the real IP address of the client with php
As the internet growing as long as spamming,hacking,fishing,bots also increasing,there by normal user can easly decepted by with them. in many security application we need to find the real ip address to ban or record the ip related activities.here we use small function that returns and modify the PHP global remote address variable.
Usually we’ll use $_SERVER['REMOTE_ADDR'] to get clients IP address. But this doesn’t return the real IP address all time. Basically when someone using PROXY that valiable returns proxy IP the client using. So here’s a function you can use to detect real ip address of client. Here are extra Server variable which might be available to determine the exact IP address of the client’s machine in PHP, they are HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR
1 2 3 4 5 6 7 8 | function real_ip(){ if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])){ $_SERVER['REMOTE_ADDR']=$_SERVER['HTTP_X_FORWARDED_FOR']; }elseif(isset($_SERVER['HTTP_X_REAL_IP']){ $_SERVER['REMOTE_ADDR']=$_SERVER['HTTP_X_REAL_IP']; } return $_SERVER['REMOTE_ADDR']; } |










You have a wonder ful set of help guides….but this one not working,,,i have tried checking this with many proxy servers…but the original ip is never detected….
Yes,you are right. now many proxy referrals come with real web browser environment. So we need to improve our technical solutions.it also depends on apache, php environment of server.
Leave your response!
Html »
Ie css hack reference
CSS difference Between IE6,IE7,IE8
As a designer we experience the most bizzare conditions with internet explerer because it doesn’t follow w3 standereds mostly while rendering elemets and Box Model where moslty other Gecko browsers follow same.Even …
javascript »
prevent iframe ,frame theft
How to stop iframe, frame thefts of our site resources.
Sites like Google Image search , goodphptutorials.com and phpcamp.net displays the website under the IFRAME .No one want their site to be displayed it …
wordpress »
wordpress custom contact form template
How to make contact us form page for wordpress default theme .
We know that word press is popular open source blog.it has thousands of plugins to enhance it’s features.we can extend it …
Archive
Categories
Tags
sponsers
sponsers