How can a PHP script be automatically executed when loading an index.html page?
To automatically execute a PHP script when loading an index.html page, you can use server-side includes or rewrite rules in your web server configuration to parse HTML files as PHP. This way, the PHP script will be executed before the HTML content is served to the client.
```php
# Add the following lines to your .htaccess file to parse HTML files as PHP
AddType application/x-httpd-php .html
AddHandler application/x-httpd-php .html
# Or, if using Apache server, you can also use mod_rewrite to achieve the same result
RewriteEngine on
RewriteRule ^index\.html$ index.php [L]
```
Make sure to adjust the configuration based on your server setup and file paths.