- Open the config.php file and locate the value you want to retrieve. Ensure that the value is defined as a variable in the file. For example, let's say you have a configuration variable named $database_host with the value 'localhost' in config.php.
- In footer.php, include the config.php file at the beginning of the script. This will make the variables defined in config.php accessible in footer.php. You can use the include or require statement for this.
Code:
<?php require 'config.php'; // Now the variables from config.php are accessible here echo "Database host: " . $database_host;

Leave a comment: