猿问

在 php 文件中添加一个 Php 文件

我正在尝试在 php 文件中添加一个 php 文件,但它不起作用..


<?php

echo '


<p><a href="/Confusing_English/A_Lot_Of_Many.html"><strong> A Lot Of & Many </strong></a></p>


<p><a href="/Confusing_English/Already.html"><strong> Already </strong></a></p>



 <?php include 'Include/adsense.php'; ?>    


  ';

?>


翻过高山走不出你
浏览 178回答 3
3回答

暮色呼如

您已经在字符串引号 ( 'not executable string') 中编写了所有内容,因此解释器将其读取为字符串,而不是可执行代码。也不需要echo使用 PHP来处理纯 HTML。请按以下步骤操作:<p><a href="/Confusing_English/A_Lot_Of_Many.html"><strong> A Lot Of & Many </strong></a></p>&nbsp; &nbsp;&nbsp;<p><a href="/Confusing_English/Already.html"><strong> Already </strong></a></p>&nbsp; &nbsp;&nbsp;<?php include 'Include/adsense.php'; ?>&nbsp;解释有一个小代码示例:<?php // start tagecho 'This is not executable'; // it will just show on your screen "This is not executable"include 'Include/adsense.php'; // let's consider is as command, PHP parser will read it as a single command, in this case it tells to include given fileecho 'Not executable either'; // part inside quotes is not executable, so it will output on the screen "Not executable either"?> // end tag我认为您应该阅读一些有关 PHP 基础知识的文章。下面的链接(w3schools 在某些情况下不是很好,但对于基础知识,我认为它很好)。

蓝山帝景

您正在<?php输入一个已经从 PHP 输出的字符串,只需将您的代码更改为<?php&nbsp; &nbsp;echo '&nbsp; &nbsp;<p><a href="/Confusing_English/A_Lot_Of_Many.html"><strong> A Lot Of & Many </strong></a></p>&nbsp; &nbsp;<p><a href="/Confusing_English/Already.html"><strong> Already </strong></a></p>&nbsp; &nbsp;';&nbsp; &nbsp; include 'Include/adsense.php';?>

杨魅力

试试这个:<?phpecho '<p><a href="/Confusing_English/A_Lot_Of_Many.html"><strong> A Lot Of & Many </strong></a></p><p><a href="/Confusing_English/Already.html"><strong> Already </strong></a></p>';include 'Include/adsense.php';?>
随时随地看视频慕课网APP
我要回答