$ _ SERVER ['PATH_INFO']和$ _ SERVER ['ORIG_PATH_INFO']在PHP [英] $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO'] in php

查看:371
本文介绍了$ _ SERVER ['PATH_INFO']和$ _ SERVER ['ORIG_PATH_INFO']在PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是它们之间的区别?如何使用它们。 I 的print_r($ _ SERVER)。没有 $ _ SERVER ['PATH_INFO']和$ _ SERVER的结果['ORIG_PATH_INFO'] 。为什么?如何启用它。我已经阅读对他们的PHP手册,但还是不理解他们。谢谢

what's the difference between them? how to use them. i print_r($_SERVER). there is no result of $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO'] .why? how to enable it.i have read the php manual on them, but still don't understand them. thank you

推荐答案

PATH_INFO 变量仅present如果你调用一个这样的PHP脚本:

The PATH_INFO variable is only present if you invoke a PHP script like this:

http://www.example.com/phpinfo.php/HELLO_THERE

这仅仅是 / HELLO_THERE 的.php 脚本之后的部分。如果你不喜欢调用该URL,不会有一个 $ _ SERVER [PATH_INFO] 环境变量。

It's only the /HELLO_THERE part after the .php script. If you don't invoke the URL like that, there won't be a $_SERVER["PATH_INFO"] environment variable.

PORIG _ preFIX是有点少见。 PATH_INFO 是一个标准的CGI环境变量,不应该是prefixed。你在哪里看的? (有大约PHP3 / PHP4一些问题,如果你通过的cgi-bin /调用PHP间preTER - 但几乎没有人今天这样的设置)

The PORIG_ prefix is somewhat uncommon. PATH_INFO is a standard CGI-environment variable, and should never be prefixed. Where did you read that? (There were some issues around PHP3/PHP4 if you invoked the PHP interpreter via cgi-bin/ - but hardly anyone has such setups today.)

有关参考: http://www.ietf.org/rfc/rfc3875

这篇关于$ _ SERVER ['PATH_INFO']和$ _ SERVER ['ORIG_PATH_INFO']在PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆