If-statement: how to pull 2nd GET variable
Posted
by arsoneffect
on Stack Overflow
See other posts from Stack Overflow
or by arsoneffect
Published on 2010-02-13T05:14:45Z
Indexed on
2010/06/03
9:04 UTC
Read the original article
Hit count: 178
How do I get this to pull my 2nd variable? (I already have a switch
setup)
<body id="<?php if (! isset($_GET['page'])) { echo "home"; } else { $_GET['page']; echo $page; } ?>">
I have a switch
statement that pulls the pages from
index.php?page=#####
and I have just added this part to my switch
:
index.php?page=####§ion=#####
Right now, if I am on page=photos, my code ends up being:
<body id="photos">
I need to make it so that if any link has the "sections" variable on it like this page=photos§ion=cars it uses the same ID:
<body id="photos">
© Stack Overflow or respective owner