Simple If statement question

Hello all,

I have this styleswitcher I got from 456Berea st.

I am trying to have an IF statement find out which stylesheet is selected in order to change the message about changing back to Normal from Hi Contrast and viceversa…

Here is the code from 456 that is at the top of the page:


$layout = (isset($_COOKIE['layout']) && ($_COOKIE['layout'] == "lassen_low_style")) ? "lassen_low_style" : "lassen_style";

This is the switcher php:


<?php
    $layout = (isset($_COOKIE['layout']) && ($_COOKIE['layout'] == "lassen_low_style")) ? "lassen_style" : "lassen_low_style";
    setcookie("layout", $layout, time()+31536000, '/');
    $ref = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : "http://{$_SERVER['SERVER_NAME']}/";
    header("Location: $ref");
?>

Here is my SIMPLE code:


<?php echo $layout; ?>
<a href="inc/styleswitch.php">
<?php
    if(!$layout = "lassen_style"){
        echo = "View in Normal mode";
    }else{
        echo = "View in High Contrast mode";
    }
 ?>
 </a>

Now when it switches to Hi Contrast from Regular mode… I can echo $layout and it says lassen_style and when from Regular to Hi Contrast it says lassen_low_style just as the style sheets reflect, however, the text in the link doesn’t change…

When the stylesheet is Lassen_Style I would like it to say, View in High Contrast Mode? and vice versa…

Any clues here?