mysql操作类(16)
来源:未知 责任编辑:责任编辑 发表时间:2015-10-08 14:15 点击:次
}
//取得mysql 服务器信息
public function mysql_server($num=''){
switch ($num){
case 1:
return mysql_get_server_info();
break;
case 2:
return mysql_get_host_info();
break;
case 3:
return mysql_get_client_info();
break;
case 4:
return mysql_get_proto_info();
break;
default:
return mysql_get_client_info();
}
}
public function __destruct(){
if(!empty($this->result)){
$this->free();
}
mysql_close($this->conn);
}
//获得客户端真实的ID地址
function getip() {
if (getenv("HTTP_CLIENT_IP") && strcasecmp(getenv("HTTP_CLIENT_IP"), "unknown")) {
$ip = getenv("HTTP_CLIENT_IP");
} else
if (getenv("HTTP_X_FORWARDED_FOR") &&strcasecmp(getenv("HTTP_X_FORWARDED_FOR"), "unknown")) {
$ip = getenv("HTTP_X_FORWARDED_FOR");
} else
if (getenv("REMOTE_ADDR") && strcasecmp(getenv("REMOTE_ADDR"), "unknown")) {
$ip = getenv("REMOTE_ADDR");
} else
if (isset ($_SERVER['REMOTE_ADDR']) && $_SERVER['REMOTE_ADDR'] &&strcasecmp($_SERVER['REMOTE_ADDR'], "unknown")) {
$ip = $_SERVER['REMOTE_ADDR'];
相关新闻>>
- 发表评论
-
- 最新评论 更多>>