다음과 같이 parameter_file.php 파일에 PHP 코드가 있습니다. index.php 파일에서이 파일을 호출했을 때, 어떤 값도 읽지 않았습니다! 이 두 파일은PHP include 또는 include_once 함수가 작동하지 않습니다.
<?php include 'parameter_file.php';
echo "value is : ".$color;
?>
어디 알려 주시기 바랍니다 수를 같은 디렉토리 및 사용하여 최신 PHP 5.4
parameter_file.php의 index.php의
<?php
$color='red';
$car='BMW';
?>
몸에서 존재/무엇을 문제는 ?
동일한 폴더에있는 parameter_file.php 및 index.php ?? – Sebastien
include 대신에 require를 사용하면 오류에 대해 더 자세한 정보가 표시됩니다. require 'parameter_file.php'를 사용할 때 오류 메시지가 표시되는지 확인하십시오. –
아마도 parameter_file.php는 index.php와 같은 폴더에 있지 않습니다.이 경우 'include'../ folderhere/parameter_file.php ';'또는 이와 비슷한 것을 사용해야합니다. – Sebastien