From 04aa00c17fe16e2aa5df18ec3420a02391addef3 Mon Sep 17 00:00:00 2001 From: IoTcat Date: Wed, 20 Mar 2019 17:06:01 +0800 Subject: [PATCH] api log --- server/cn/home/www/api/www-api/photo/index.php | 4 ++++ server/cn/home/www/api/www-api/pic/index.php | 2 ++ server/cn/home/www/functions.php | 4 +--- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/server/cn/home/www/api/www-api/photo/index.php b/server/cn/home/www/api/www-api/photo/index.php index 7bc6d9d..daf99ec 100644 --- a/server/cn/home/www/api/www-api/photo/index.php +++ b/server/cn/home/www/api/www-api/photo/index.php @@ -1,4 +1,5 @@ "photo", "timestamp" => date('Y-m-d H:i:s', time()), "ip" => ip2long(get_ip()), "_from" => get_from(), "content" => $_REQUEST['i']."/".$id)); + + die(); \ No newline at end of file diff --git a/server/cn/home/www/api/www-api/pic/index.php b/server/cn/home/www/api/www-api/pic/index.php index 23b97fe..7019207 100644 --- a/server/cn/home/www/api/www-api/pic/index.php +++ b/server/cn/home/www/api/www-api/pic/index.php @@ -1,4 +1,5 @@ "pic", "timestamp" => date('Y-m-d H:i:s', time()), "ip" => ip2long(get_ip()), "_from" => get_from(), "content" => $r."/".$id)); die(); diff --git a/server/cn/home/www/functions.php b/server/cn/home/www/functions.php index 66fca00..d5ac911 100644 --- a/server/cn/home/www/functions.php +++ b/server/cn/home/www/functions.php @@ -407,9 +407,7 @@ return ($ip); /** get from address **/ function get_from(){ - if($_SERVER['remote_addr']) return $_SERVER['remote_addr']; - elseif($_SERVER['HTTP_HOST']) return $_SERVER['HTTP_HOST']; - elseif($_SERVER['HTTP_REFERER']) return $_SERVER['HTTP_REFERER']; + if($_SERVER['HTTP_REFERER']) return $_SERVER['HTTP_REFERER']; elseif($_REQUEST['from']) return $_REQUEST['from']; }