• mrtagomi

    (@mrtagomi)


    I’m using a method suggested by Kafkaesqui of determining whether the adress you’re at is *www.mysite.com/index.php* or *www.mysite.com/whatever* — so I can alter my homepage without essentially altering the way every other page/post displays by default. This is what I’m using at the moment and it works great:

    (this code is in my index.php / ‘mainpage template’)

    <?php if($_SERVER[‘QUERY_STRING’]) : ?>
    //do stuff
    <?php else : ?>
    //do different stuff
    <?php endif: ?>

    But what I want to know is how I can extend this to

    1. first check if browser is at index.php, and if so, do //stuff
    2. check if browser is at http://www.mysite.com/?cat=*anything*, and if so, do //otherstuff
    3. else do //normalstuff

    so my guess would be that I should use a *switch/case* type of function instead of *if/else*… how can I do this?

    btw thanks support volunteers, I’ve found answers to about a dozen questions by searching these forums so far 🙂

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘<?php if($_SERVER[‘QUERY_STRING’]) : ?>’ is closed to new replies.