English 中文(简体)
包括(a) 从包括在内的档案中打电话时没有保持沉默
原标题:include() fails silently when called from an included file

我在把档案列入远程服务器方面有问题(但用我的当地Windows PHP+Apache配置,它做的是罚款......)。

当我试图将档案列入类似档案时,就会出现问题:

目录:

<?php

include("Dir1/File1.php");

?>

页: 1

<?php

include("File2.php");
include("File3.php");

echo("<p>File1 include done.</p>");

?>

Dir1/File2.php的内容

<?php
echo("<p>File2 include done.</p>");
?>

Dir1/File3.php的内容

<?php
echo("<p>File3 include done.</p>");
?>

文件2.php和文件3。 php没有评估过,但当我改变例如档案2.php,将文件99.php(有些不存在档案)时。 我得到标准警告,档案确实存在。

但是,当我改变Dir1/File1.php的内容时,就包括这样的档案:

<?php

include("Dir1/File2.php");
include("Dir1/File3.php");

echo("<p>File1 include done.</p>");

?>

然后对档案进行评估......

问题回答

象你这样的声音在你的道路上没有“(现在的夹)。 您应修改您的网址:www.un.org。 你们可以通过做事,找到生活和测试服务器的价值。

<?php
phpinfo();
?>

我每次都这样做:

<?php require_once($_SERVER[ DOCUMENT_ROOT ] .  /path/to/File3.php ); ?>

采用完整道路的工艺包括:

include(dirname(__FILE__) . "/Dir1/File3.php");




相关问题
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 ...

热门标签