我在一个看起来像这样的网页上有一系列 php 包含...
<?php include 'folder1/file.php'; ?>
<?php include 'folder2/file.php'; ?>
<?php include 'folder3/file.php'; ?>
它们在我的代码编辑器中看起来像上面那样,但是当我上传到我的服务器时,当我查看源代码时它会像这样查看......
<?php include 'folder1/file.php'; ?>
<?php include 'folder3/file.php'; ?>
<?php include 'folder3/file.php'; ?>
所以我想也许文件没有上传……所以我把代码改成了这个并上传了页面……
<?php include 'folder1/file.php'; ?>
<?php include 'folder3/file.php'; ?>
当在任何浏览器中查看它时,它按预期显示,只显示两个包含。告诉我网页正在正确上传到服务器。我清空了缓存,刷新了页面,什么也没有。那么当我将代码改回这个并上传时......
<?php include 'folder1/file.php'; ?>
<?php include 'folder2/file.php'; ?>
<?php include 'folder3/file.php'; ?>
它仍然在实时页面中显示
<?php include 'folder1/file.php'; ?>
<?php include 'folder3/file.php'; ?>
<?php include 'folder3/file.php'; ?>
我在服务器上安装了 PHP,所有其他 PHP 代码/包含都可以正常工作。以下 PHP 代码运行正常。
<?php phpinfo(); ?>
这是文件夹 2/file.php 的代码
<div class="propertylistingbox" id="propertylistingbox">
<div class="proplistingleft" id="proplistingleft"><a href="second-base/index.php"><img src="/second-base/images/FirstBase01.png" alt="Second Base Exterior" width="284" height="193" border="0" /></a>
<div class="reservation-request-button"><a href="../properties-search.php"></a>
</div>
</div>
<div class="propertylistingmain" id="propertylistingmain">
<div class="propheader" id="propheader">
<h3>SECOND BASE</h3>
</div>
<div class="propbulletlist" id="propbulletlist">
<ul>
<li>Located In Oneonta, NY</li>
<li>Accommodates 4</li>
<li>High Speed Internet</li>
<li>2 Bedrooms</li>
<li>Close to 3 bedroom apartment "First Base"</li>
<li>1.25 Miles to Cooperstown Baseball World</li>
<li>2.75 Miles to Cooperstown All Star Village</li>
<li>19 Miles to Cooperstown Dreams Park</li>
</ul>
</div>
<div class="propdetails" id="propdetails">
<div class="details-button">
<a href="second-base/index.php">Click For More Details</a>
</div>
</div>
<div class="propspecialsbanner" id="propdetails2"></div>
<div class="propcalendarmaplink" id="propcalendarlink"><strong><a href="second-base/index.php">CALENDAR OF AVAILABILITY</a></strong><br />
<strong><a href="https://maps.google.com/maps?q=119+Chestnut+Street,+Oneonta,+NY+13820&hl=en&sll=42.454503,-75.069752&sspn=0.017447,0.046391&oq=119+CHESTNUT+STreONEONTA+NY+13820&hnear=119+Chestnut+St,+Oneonta,+Otsego,+New+York+13820&t=m&z=17" target="_new">GOOGLE MAP</a></strong></div>
</div>
</div>