Dear brothers. Excuse me, I am a novice. I have bound multiple domain names to the same web page. For example, if I want www.bd.com to access it, the background image should be changed to b.jpg. Otherwise, the default is the background image set before
WBOY2023-06-29 10:48:32
<?php $domain = $_SERVER['HTTP_HOST']; if ($domain == 'www.bd.com') { $backgroundImage = 'b.jpg'; } else { $backgroundImage = 'default.jpg'; // 默认背景图 } ?> <!DOCTYPE html> <html> <head> <style> body { background-image: url(<?php echo $backgroundImage; ?>); } </style> </head> <body> <!-- 页面内容 --> </body> </html>