If you want to add your IP address to a Wordpress Blog then you can complete the following actions with the code below:
[php]<?php
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
if ($ip)
{
// Note that HTTP_X_FORWARDED can contain multiple IP addresses
$ip = explode(',', $ip);
$ip = $ip[0];
$proxy = $_SERVER['REMOTE_ADDR'];
echo '
}
else
{
$ip = $_SERVER['REMOTE_ADDR'];
echo '
}
?>
[/php]
[php]<?php
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
if ($ip)
{
// Note that HTTP_X_FORWARDED can contain multiple IP addresses
$ip = explode(',', $ip);
$ip = $ip[0];
$proxy = $_SERVER['REMOTE_ADDR'];
echo '
Your IP address is: '.$ip.'
Your proxy: '.$proxy.'
}
else
{
$ip = $_SERVER['REMOTE_ADDR'];
echo '
Your IP address is: '.$ip.'
';}
?>
[/php]
Tags
internet