What is the impact of using absolute paths versus relative paths in PHP includes on password protection?

Using absolute paths in PHP includes can expose sensitive information like passwords if the file structure is compromised. To avoid this, it's recommended to use relative paths instead. By using relative paths, you can ensure that the included files are only accessible within the intended directory structure, thus enhancing the security of your application.

// Incorrect way using absolute path
include('/var/www/html/config.php');

// Correct way using relative path
include('config.php');