i would like my program to have a config.php with passwords and other
stuff.
i would like to have a functions.php to hold all my functions.
i would like the functions.php to include/require the config.php as it
will need it for database stuff.
i cant seem to get the functions in my functions.php to see the
variables in config.php
when i run the following on my machine i just get notices about the
undefined variables. what is wrong with this?
thanks for any help!!
here is the basic layout:
index.php:
<?php
require_once "functions.php";
myfunction();
?>
functions.php:
<?php
require_once "config.php";
function myfunction()
{
print("user: $user , server: $server , pass: $pass ");
}
?>
config.php:
<?php
$user = "root";
$server = "localhost";
$pass = "pass";
?>