从URL获取PHP远程地址信息 [英] Obtaining PHP Remote Address Info from URL
问题描述
我是PHP新手,热衷于学习,我想知道人们是否可以让我知道如何获取phpinfo信息,特别是在Apache环境下,变量REMOTE_ADDR?
I am new to PHP and keen to learn and I was wondering if people could please let me know how to obtain phpinfo information, specifically under the Apache Environment, the variable REMOTE_ADDR?
我基本上为用户提供了一个特定网站的url,最终该网站返回给他们一个csv文件,用户可以在其中保存/删除或取消该文件.
I basically provide a user with a url to a partcular website, which ultimately returns them a csv file where they can either save/delete or cancel.
在同一URL上,我想知道是否可以调用PHP函数来获取此信息,或者甚至更好地直接从URL调用变量吗?
On the same URL, I was wondering if I can call a PHP function to obtain this information or even better, call the variable directly from the URL?
任何帮助将不胜感激.
谢谢.
推荐答案
您可以从 $ _ SERVER 全局数组
$_SERVER["REMOTE_ADDR"];
对于URL,您可以使用 $ _GET 通过URL传递数据.
As for the URL, you can use $_GET to pass data through a URL.
这篇关于从URL获取PHP远程地址信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!