This is a php code snippet that can help you to find out the Shared IP/Server IP of the server.
<?php
echo GetServerIP ;
function IsVPS()
{
$a = '/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'';
exec($a,$c);
if($c[0] == "")
return true ;
else
return false ;
}
function GetServerIP()
{
if(IsVPS == true )
$a = '/sbin/ifconfig venet0:0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'';
else
$a = '/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'';
exec($a,$c);
return $c['0'];
}
?>