vendredi 6 avril 2018

How do you change a CSS link document with PHP if/else?

Trying to set up templates on a site I am working on, and I want to change the linked stylesheet document instead of using PHP within the CSS. Would this be possible? Thanks.

<?php

    require 'includes/templates.php';

    if($_COOKIE['template'] == $blocky) {

        echo "<link rel="stylesheet" href="/testpages/css/blocky.css">";

    }

    else {

        echo "<link rel="stylesheet" href="/testpages/css/default.css">";

    }

?>

Aucun commentaire:

Enregistrer un commentaire