$ _GET / $ _REQUEST与字符串不同?

时间:2012-05-22 15:05:23

标签: php

我正在尝试使用此库http://code.google.com/p/php-tail/

当它工作时它是一个很好的工具,但我坚持一些配置。

目前我正在编写的文件是在构建类时设置的:

$tail = new PHPTail("example.log");

这很好,

也是如此
$log_file = "example.log";
$tail = new PHPTail($log_file);

什么不起作用(使用URL localhost / tail.php?file = example

$log_file = $_GET['file'].".log";
$tail = new PHPTail($log_file);

也不是

$log_file = $_REQUEST['file'].".log";
$tail = new PHPTail($log_file);

即使页面的标题设置了正确的日志路径,但脚本也不会运行。我没有看到任何PHP,JS或AJAX错误。

1 个答案:

答案 0 :(得分:0)

只需检查你回来的字符串man ...当你甚至不提供输出时,你怎么能说它是$ GET或$ REQUEST!

如果它是任何东西,它绝对是你传递请求的方式!