Login form



PHP. Inserted files: include, require, include_once, require_once, PART 1
include generates warning, script is interpreted:

Warning: require(constants.php) [function.require]: failed to open stream: No such file or directory in   .... on line .....


require
generates fatal error, script is stopped:


Fatal error: require() [function.require]: Failed opening required 'constants.php' (include_path='.:') in   .... on line ......


Using require_once and include_once file is inserted only one time afrer lots of insertions. require_once is similar to require, include_once- to include.

include example:
<?

$a = 10;
for ($i=1; $i<=11; $i++){
include("be_funkcijos.php");
}

$a=include("be_funkcijos.php");

echo "<b>INCLUDE</b>: $a";

?>

be_funkcijos.php:
<?
echo "tekstas $i ". microtime()."kintamasis \$a $a <br>" ;
return "grazinama reiksme";
echo "nematoma eilute";
?>

With warnings:
<?

include("1.php");
include("2.php");
include "3.php";
@include("4.php");
echo "<br> kodas tesiamas<br>";

?>





 
[ BBC news ][ Yahoo news ][ Linux guru ][ Webmaster ACE ]