<p>I am desiging a new website for my company and I am trying to implement switch navigation which is what I have used on all my sites in the past.</p>

<pre><code>&lt;?php
switch($x) {

default:
include("inc/main.php");
break;

case "products":
include("inc/products.php");
break;

}
?&gt;
</code></pre>

<p>For some reason when I go to index.php?x=products nothing happens, it still displays inc/main.php, in other words it hasn't detected the X variable from the URL. Is this something to do with global variables?</p>

Yes, your PHP configuration has
correctly
got
```
register_globals
```
turned off, because that's incredibly insecure.
Just put:
```
```
$x = $_REQUEST['x']
```
```
at the top of your script.
You can also use
```
$_GET
```
if you specifically only want this to work for the
```
GET
```
HTTP method.  I've seen some people claim that
```
$_REQUEST
```
is somehow insecure, but no evidence to back that up.