为什么PHP代码没有被处理?
我有一个PHP页面Read.PHP,它回显另一个PHP文件test.PHP.test.PHP的内容,其中包含一些PHP代码,但这些代码没有在Read.PHP中处理。它们照样复制 Read.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
$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文件也会导致类似的行为。