Do not panic!
分类: LINUX
2016-07-04 08:48:25
原文地址:linux c cgi获得各种环境变量 大全 作者:ubuntuer
|
这个是获得客户端ip的,通过getenv这个函数还可以获得以下一些东东
"REMOTE_ADDR",
"DOCUMENT_ROOT",
"GATEWAY_INTERFACE",
"SERVER_SOFTWARE",
"SERVER_NAME",
"SERVER_PROTOCOL",
"SERVER_PORT",
"SERVER_ADMIN",
"SERVER_SIGNATURE",
"REQUEST_METHOD",
"REQUEST_URI",
"PATH_INFO",
"PATH_TRANSLATED",
"SCRIPT_NAME",
"SCRIPT_FILENAME",
"QUERY_STRING",
"REMOTE_HOST",
"REMOTE_ADDR",
"REMOTE_USER",
"REMOTE_IDENT",
"CONTENT_TYPE",
"CONTENT_LENGTH",
"HTTP_ACCEPT",
"HTTP_ACCEPT_CHARSET",
"HTTP_ACCEPT_LANGUAGE",
"HTTP_ENCODING",
"HTTP_USER_AGENT",
"HTTP_CONNECTION",
"HTTP_HOST",
"HTTP_REFERER",
"AUTH_TYPE"