html - Choose unique stylesheet for a single page with php
My question is: is it possible to have different stylesheets on the same website? I’m already aware that its possible to link several stylesheets to each other but that isn’t quite what I’m looking for. My goal is to make it possible for a logged in administrator to edit a stylesheet that only affects the look of the start page.
The website uses php for connecting the pages to one another and the links to the stylesheets are located in theheader.php
document:
<?php if(isset($_SESSION['stylesheet'])): ?>
<link rel="stylesheet" href="style/<?php echo $_SESSION['stylesheet']; ?>">
<?php else: ?>
<link rel="stylesheet" href="style/stylesheet.css" title="General stylesheet">
<?php endif; ?>
Would it be possible to modify this code so that an alternative stylesheet controls the look of the front page exclusively?
Answer
Solution:
According to your comment that the start page has a variable
$pageId
with the valuehem
you can include a stylesheet exclusively to the start page by adding