English 中文(简体)
纳入从SISSI获得的PHP的正确方式
原标题:What s the correct way to include PHP from an SSI
  • 时间:2010-12-16 17:53:30
  •  标签:
  • php
  • ssi

I m在使用一些SSI的网站上工作。 由于这些是静态的,因此,作为<代码>.shtml的页码,而不是转换为.php。 现在的问题是,在其中之一,我要生动地把一些内容带进了营地。 采取下列正确方式,还是找到其他/更好的解决办法。 我现在做的是:

<!--test.shtml-->
<!DOCTYPE html>
<html lang="en" dir="ltr">
<body>
<!--#include virtual="/test.php" -->
</body>
</html>

<!--test.php-->
<?php echo  Hello from php ; ?>

I ve read that this shouldn t work but where I read that, it was referring to Apache 1.3. On my server at home I m running Apache 2.[something] and it works fine, it also works on the server where the site will be hosted. So is this something that didn t work in 1.3 but does in 2 or am I just getting lucky somehow and really should be doing it a different way?

内容I m的生成只是为现场的导航添加一个门类/门类,以突出目前这一页,因此,PHP似乎没有什么超高技能,因为它在首次产生后将大量固定下来,我可以把PHP的产出放在服务器Ippose上,但也许首先有更好的方式这样做(?)。

感谢您的帮助。

EDIT - Not an answer, but in relation to my alternative method question. I found a perhaps more suitable (I hesitate to say cleaner, since I m sure that can be argued til the cows come home) method for my situation. Since I am not currently using PHP for anything else on the site, I ll stick with it for now. It is as outlined by Dan M here.

最佳回答

Since these are static it makes sense to serve the pages as .shtml and not convert to php includes and serve as .php

既然你在这两种情况下都重新使用PHP发动机,而且整个页面都需要在作为<代码>.php<>>>>的< page的两种情况下都使用PHP发动机。 如你重新保证,还将在阿帕奇1x服务器上工作。 然后,你可以像你所建议的那样,仅按时间顺序排出一个页,然后在<条码>上排入“名录>。

问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...