fix url with include page vs updated url to new file
<p>There is a technique that I've seen in a web site,having one fixed index.php file and include pages in that file dynamically .</p>

<p>I mean like having index.php that have JUST this code in  :</p>

<pre><code>&lt;?php
    if ($_GET['page'])
    {
        $url= $_GET['page'].".php" ;
        if(is_file($url))
        {
            include $url;
        }
        else
        {
            echo ' requested page is not found :'.$url;
        }
    }
    else
    {
        include 'home.php';
    }
?&gt;
</code></pre>

<p>and any herf location will have index.php?page=ToPage</p>

<p>url will be like www.site.com/index.php?page=page1, www.site.com/index.php?page=page2, and so on ..</p>

<p>in other hand most of the sites uses normal move to page, like any href will make you go another page .
In this way the url will be www.site.com/index.php, www.site.com/page1, www.site.com/page2.php .</p>

<p>i want to know what is the advantage\disadvantage on every method .
and is it safe to use the first method ?</p>