How to get current real User/Client ip address in PHP.

How to use $_SERVER[‘REMOTE_ADDR’] to get current user IP address and show on screen.

Detecting and saving current user ip is one of the most important things for every website because at the present times lots of people trying to access your website to unleash the wrong content on internet and if you have stored all visitors IP address then this will help you to track down the wrong persons. So this is also a security point. PHP gives us inbuilt $_SERVER methods to access the real time visitor ip address. So here is the complete step by step tutorial for How to get current real User/Client ip address in PHP and disply on screen.
android-project-download-code-button

How to get current real User/Client ip address in PHP.

Code for get-ip.php file.
 <!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
</head>

<body>

<?php

 $UserIP = $_SERVER['REMOTE_ADDR'];
 
 echo $UserIP;
?>

</body>
</html>

Click here to download How to get current real User/Client ip address in PHP project file with source code.

Comments

Popular posts from this blog

How to add image, header, and footer in PDF | PHP FPDF Tutorial Final

log in with facebook , paypal, php to pdf

How to make awesome stylish comment input box in PHP language for my website.