Code to display visitors IP address on website

get_ip_list below is a function that you must call in order to get something.

function get_ip_list() {
$tmp = array();
if (isset($_SERVER[’HTTP_X_FORWARDED_FOR’]) && strpos($_SERVER[’HTTP_X_FORWARDED_FOR’],’,')) {
$tmp += explode(’,',$_SERVER[’HTTP_X_FORWARDED_FOR’]);
} elseif (isset($_SERVER[’HTTP_X_FORWARDED_FOR’])) {
$tmp[] = $_SERVER[’HTTP_X_FORWARDED_FOR’];
}
$tmp[] = $_SERVER[’REMOTE_ADDR’];
return $tmp;
}
echo echo implode(”,”,get_ip_list());

Redirect by PC or mobile access

php code as follows:

$iswap = isset($_SERVER[’HTTP_ACCEPT’])? $_SERVER[’HTTP_ACCEPT’]:”;
if(strpos($iswap,”wap”)>0)
{
@header(”Location: /wap/”);
}

Add php code into html for lunarpage.com

Add php code into html for lunarpage.com linux host.

try this line in a blank .htaccess

AddType application/x-httpd-php php html

Add php code into html for php5

AddType application/x-httpd-php5 .html .htm .php
AddHandler application/x-httpd-php5 .html .htm .php