I want to use functions in different files but there are some errors:
1st filename is
admin.php
<?
include($DOCUMENT_ROOT.'/gl/Forms.php');
//it should connect to the /home/httpd/html/gl/Forms.php
db_conn();
// should use function db_conn
?>
and 2nd filename is
Forms.php
<?
function db_conn($connect_db) {
$connect_db = mysql_connect("localhost", "webuser", "");
if (!$connect_db) echo "No can DO";
echo "Woila";
}
?>
when I execute admin.php it should connect to Forms.php, use function db_conn and
display text "Woila" or "No can DO" but it shows me: this error
Warning: Failed opening '/home/httpd/html/gl/Forms.php' for inclusion
(include_path='.:/usr/share/php') in /home/httpd/html/gl/admin.php on line 2
Fatal error: Call to undefined function: db_conn()
in /home/httpd/html/gl/admin.php on line 4
I'm using RedHat 6.2
php 4.0
apache 1.3
What should I do?
Thaks.