PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am switching from HTML to PHP so I'm still fairly new to the programming.
I saved some variables that I want to use on all pages in a file called variables.php so I can use them all over the site and change them easily. The problem is that I don't know how to load them.
I tried the include('variables.php') tag first but it takes the file literally and doesn't parse it.
I've searched all over the net and can't find anything about loading variables from another file.
you may need add tags <?php and ?> at the begin and end of variables.php
for example.
if variables.php likes this
$username ="username"
$password = "password";
when you include this file the content of the variables.php will be show in the explorer, If you want to execute the php file, you need this,
<?
$username ="username"
$password = "password";
?>