putting link for navigation instead of putting code on all pages again and again
<p>This is my header file,and I am including This file in all other pages </p>

<pre><code>&lt;html&gt;
    &lt;body&gt;
        &lt;div  id="nav"&gt;
        &lt;ul id="menu"&gt;
                &lt;?php
                if(!logged_in())
                {
                echo "{$list1}";
                }
                ?&gt;
                &lt;?php
                if(logged_in())
                {
                echo "{$list1}";

                }
                ?&gt;
                &lt;?php
                echo "{$list}";

                ?&gt;
                 &lt;?php  
                        if($flag=="2")
                        {
                echo "{$list4}";
                        }
                        if($flag=="1")
                        {
                        echo "{$list5}";
                        }
                        ?&gt;  
  &lt;/ul&gt;

    &lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>to create navigation in all other files i have to include this code in all files ,and have to put id as current <code>id=\"current\"</code> for particular page ,so that i can indicate current page indication on navigation bar,in what way i can write this code so that i don't need to include the whole code in all pages instead of just some link </p>

<pre><code>&lt;?php include("includes/header.php"); ?&gt;
&lt;?php
                $list1= "&lt;li id=\"current\"&gt;&lt;a href=\"h.php\"&gt;H&lt;/a&gt;&lt;/li&gt;";          
                $list2= "&lt;li &gt;&lt;a href=\"he.php\"&gt;Home&lt;/a&gt;&lt;/li&gt;";
                $list="";
                $list.="";
                if(!logged_in())
                {
                $list.="&lt;li &gt;&lt;a href=\"\"&gt;R&lt;/a&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=\"c.php\"&gt;C&lt;/a&gt;&lt;/li&gt;
&lt;li &gt;&lt;a href=\"y.php\"&gt;y&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;";

$list.="&lt;li &gt;&lt;a href=\"w.php\"&gt;w&lt;/a&gt;&lt;/li&gt;";
$list.="&lt;li &gt;&lt;a href=\"l.php\"&gt;l&lt;/a&gt;&lt;/li&gt;";

                }
                $list4="&lt;li &gt;&lt;a href=\"p.php\"&gt;P&lt;/a&gt;&lt;/li&gt;"; 
                $list5.="&lt;li&gt;&lt;a href=\"my.php\"&gt;My&lt;/a&gt;&lt;/li&gt;";
   ?&gt;
</code></pre>
