Ad Code

Ticker

6/recent/ticker-posts

Ip_with_php

This code for it make a file a name yourchoice.php php extension will require and run the file in a server . This is not a html file that run in browser you will use in Apache or in your live website .

 <?php// Function to get the client IP addressfunction get_client_ip() {    $ipaddress = '';    if (isset($_SERVER['HTTP_CLIENT_IP']))        $ipaddress = $_SERVER['HTTP_CLIENT_IP'];    else if(isset($_SERVER['HTTP_X_FORWARDED_FOR']))        $ipaddress = $_SERVER['HTTP_X_FORWARDED_FOR'];    else if(isset($_SERVER['HTTP_X_FORWARDED']))        $ipaddress = $_SERVER['HTTP_X_FORWARDED'];    else if(isset($_SERVER['HTTP_FORWARDED_FOR']))        $ipaddress = $_SERVER['HTTP_FORWARDED_FOR'];    else if(isset($_SERVER['HTTP_FORWARDED']))        $ipaddress = $_SERVER['HTTP_FORWARDED'];    else if(isset($_SERVER['REMOTE_ADDR']))        $ipaddress = $_SERVER['REMOTE_ADDR'];    else        $ipaddress = 'UNKNOWN';    return $ipaddress;}echo "Your IP address is: " . get_client_ip();

Post a Comment

0 Comments