Ich möchte auf eine externe Datei mit library-Funktionen zurückgreifen,
hab ich die include-Anweisung falsch verstanden?
-----------------------------------------------------
Datei php_lib:
function br()
{
print "<BR>";
}
function hr()
{
print "<HR>";
}
-----------------------------------------------------
Das testprogramm:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Symtec Development Studio 1.1">
<title>adr</title>
</head>
<body>
<H3> Ein php-Programm </H3>
<?php
$debug=1;
include 'php_lib.php';
br();
br();
?>
</body>
</html>
------------------------------------------------------------------------------------------------------
Das Ergebnis:
Ein php-Programm
function br() { print "
"; } print "hier ist php_lib.php
;" function hr() { print ""; }
Fatal error: Call to undefined function: br() in /srv/www/htdocs/mampfi/libtest.php on line 15
hab ich die include-Anweisung falsch verstanden?
-----------------------------------------------------
Datei php_lib:
function br()
{
print "<BR>";
}
function hr()
{
print "<HR>";
}
-----------------------------------------------------
Das testprogramm:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Symtec Development Studio 1.1">
<title>adr</title>
</head>
<body>
<H3> Ein php-Programm </H3>
<?php
$debug=1;
include 'php_lib.php';
br();
br();
?>
</body>
</html>
------------------------------------------------------------------------------------------------------
Das Ergebnis:
Ein php-Programm
function br() { print "
"; } print "hier ist php_lib.php
;" function hr() { print ""; }
Fatal error: Call to undefined function: br() in /srv/www/htdocs/mampfi/libtest.php on line 15