这样也是不行啊: display.php <!-- display.php 这个Web页面的风格由一个配置文件决定 --> <html> <head> <title>Mood Page</title> </head> <?php include("displayconf.php"); $required_file = $display.".php"; //echo $required_file; require $required_file; ?> <br><br> <center>This is the best "mood page" ever!</center> </font> </body> </html>displayconf.php <?php# displayconf.php # display.php 的配置文件 # ------------------------------------------------- # 将变量 $display 设置成下列值之一: # happy, sad, 或者 generic $display = "happy"; ?>happy.php<body bgcolor=pink text=yellow> <font size="+5"> 提示: Parse error: parse error, unexpected T_VARIABLE in J:\Web开发\PHP开发\包含文件\displayconf.php on line 6Warning: main(.php): failed to open stream: No such file or directory in J:\Web开发\PHP开发\包含文件\display.php on line 10Fatal error: main(): Failed opening required '.php' (include_path='.;d:/php/includes') in J:\Web开发\PHP开发\包含文件\display.php on line 10
$required_file = $display.".php"; 不对
Parse error: parse error, unexpected T_VARIABLE in J:\Web开发\PHP开发\分页\分页3\pageft.php on line 44Fatal error: Call to undefined function: pageft() in J:\Web开发\PHP开发\分页\分页3\pages.php on line 12 up 上面这个是上面错误? 为什么pageft()这个function在include()的文件里找不到?是不是没有真正的include进去?
display.php
<!-- display.php 这个Web页面的风格由一个配置文件决定 -->
<html>
<head>
<title>Mood Page</title>
</head>
<?php
include("displayconf.php");
$required_file = $display.".php";
//echo $required_file;
require $required_file;
?>
<br><br>
<center>This is the best "mood page" ever!</center>
</font>
</body>
</html>displayconf.php
<?php# displayconf.php
# display.php 的配置文件
# -------------------------------------------------
# 将变量 $display 设置成下列值之一:
# happy, sad, 或者 generic
$display = "happy";
?>happy.php<body bgcolor=pink text=yellow>
<font size="+5">
提示:
Parse error: parse error, unexpected T_VARIABLE in J:\Web开发\PHP开发\包含文件\displayconf.php on line 6Warning: main(.php): failed to open stream: No such file or directory in J:\Web开发\PHP开发\包含文件\display.php on line 10Fatal error: main(): Failed opening required '.php' (include_path='.;d:/php/includes') in J:\Web开发\PHP开发\包含文件\display.php on line 10
up
上面这个是上面错误?
为什么pageft()这个function在include()的文件里找不到?是不是没有真正的include进去?