<? //db connection or config file $ip = $_SERVER['REMOTE_ADDR']; MYSQL_QUERY("INSERT INTO ip VALUES ($ip)"); ?>