Page selector PHP
<p>i need to be able to get the file name and the "page" variable in one string or something. Because i need to check if you come from index.php or another page. The problem with my code is that the statement will always be "true" because "$file" only contains the file name and not the file name and the $_GET variables e.g (index.php?page=news). Any ideas guys?</p>

<pre><code>$file = mysql_real_escape_string(basename(__FILE__));

if ($file != "index.php")
    $page = mysql_real_escape_string($_GET['page']);

else
    $page = "index";
</code></pre>
