【发布时间】:2010-01-24 09:59:56
【问题描述】:
我想用 PHP 和 if 语句,我想做
if ($variable){
display html page1
}
else {
display html page2
}
我该怎么做?请注意,我不想将用户重定向到其他页面。
--编辑-- 我对其中一个文件执行此操作没有问题,但对另一个文件执行此操作太麻烦了。
--编辑-- 这是到目前为止的编码:
<?PHP
include 'uc.php';
if ($UCdisplay) {
include("under_construction.php");
}
else {
include("index.html");
}
?>
我的问题是,如果我必须为每个 php 页面创建一个 html 页面,那将是非常复杂和令人困惑的,所以我需要一些方法来显示完整的 html 页面,而不是使用 include("index.html" )
【问题讨论】:
标签: php html if-statement