isset confusion...how to show a region on a page depending on whether a querystring value exists or not?
If a querysting has a certain value, I can do the following:
<?php if (isset($_GET["nameofqs"]) && $_GET["nameofqs"] == "Test") { ?>
Show this
<?php } else { ?>
Show something else
<?php } ?>
Or, if it's an integer value:
<?php if (isset($_GET["nameofqs"]) && $_GET["nameofqs"] == 1) { ?>
Show this
<?php } else { ?>
Show something else
<?php } ?>
How do I amend the above to display content based on whether or not a querystring actually exists in the URL?
This doesn't work....
<?php if (isset($_GET["nameofqs"]) && $_GET["nameofqs"] == "") { ?>
Show this
<?php } else { ?>
Show something else
<?php } ?>
Neither does this....
<?php if (isset($_GET["nameofqs"]) && $_GET["nameofqs"] != "") { ?>
Show this
<?php } else { ?>
Show something else
<?php } ?>
Hope you can help. Thank you.
NJ