<?php if($_SERVER[‘QUERY_STRING’]) : ?>
-
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 https://www.mysite.com/?cat=*anything*, and if so, do //otherstuff
3. else do //normalstuffso 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 ??
- The topic ‘<?php if($_SERVER[‘QUERY_STRING’]) : ?>’ is closed to new replies.