Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么PHP代码没有被处理?_Php - Fatal编程技术网

为什么PHP代码没有被处理?

为什么PHP代码没有被处理?,php,Php,我有一个PHP页面Read.PHP,它回显另一个PHP文件test.PHP.test.PHP的内容,其中包含一些PHP代码,但这些代码没有在Read.PHP中处理。它们照样复制 Read.php <?php $text = 1; if ($text == 1){ $file = file_get_Contents("test.php"); echo $file; } ?> <?php $text = 1; if($t

我有一个PHP页面Read.PHP,它回显另一个PHP文件test.PHP.test.PHP的内容,其中包含一些PHP代码,但这些代码没有在Read.PHP中处理。它们照样复制

Read.php

<?php

    $text = 1;
    if ($text == 1){
        $file = file_get_Contents("test.php");
        echo $file;
    }
?>
<?php

$text = 1;
if($text == 1){
  include 'test.php';
}

?>

test.php

<html>
    <body>
        <p>Text
            <?php echo "Manish";  echo $text;>
        </p>
    </body>
</html>

正文

从web服务器检索它(
http://...
)而不是从文件系统。只有在web服务器处理PHP时才会处理它。

从web服务器检索它(
http://...
)而不是从文件系统。只有在web服务器处理PHP时,才会处理它。

Read.PHP

<?php

    $text = 1;
    if ($text == 1){
        $file = file_get_Contents("test.php");
        echo $file;
    }
?>
<?php

$text = 1;
if($text == 1){
  include 'test.php';
}

?>

Read.php

<?php

    $text = 1;
    if ($text == 1){
        $file = file_get_Contents("test.php");
        echo $file;
    }
?>
<?php

$text = 1;
if($text == 1){
  include 'test.php';
}

?>




技术上
include()
ing或
require()
ing文件也会导致类似的行为。技术上
include()
ing或
require()
ing文件也会导致类似的行为。