26 lines
498 B
PHP
26 lines
498 B
PHP
<?php
|
|
$ini = parse_ini_file("conf.ini", true);
|
|
mysql_connect($ini['db']['host'],$ini['db']['user'],$ini['db']['pass']);
|
|
mysql_select_db($ini['db']['db']);
|
|
|
|
|
|
if (function_exists( 'apache_request_headers' ))
|
|
{
|
|
$headers = apache_request_headers();
|
|
}
|
|
else
|
|
{
|
|
$headers = $_SERVER;
|
|
}
|
|
|
|
|
|
|
|
$ip = filter_var( $_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 );
|
|
|
|
print($ip);
|
|
$ip=ip2long($ip);
|
|
//$sql=mysql_query("replace into online_users (ip,date) values ($ip,NOW())");
|
|
|
|
mysql_close();
|
|
?>
|