title: PHP active Menu for Get['id']
body: <p>I use menu system for page's <code>$_GET['id']</code> but my codes dont work. How can i do it ?</p>
  
  <p>My codes below</p>
  
  <p>functions.php</p>
  
  <pre><code>function header_menu ($page) {
          echo "&lt;ul&gt;";
          if($page){
           echo "&lt;li&gt;&lt;a href='index.php'&gt;&lt;span&gt;Home&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;";
          }else {
           echo "&lt;li&gt;&lt;a class='active' href=\"index.php\"&gt;&lt;span&gt;Home&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;";
          }
          include ('admin/dbbaglan.php'); 
          $sql1 = mysql_query("SELECT * FROM sayfalar ORDER BY sira ASC");
          while($pages=mysql_fetch_array($sql1)) {
              if($page == $pages[id]) {
               echo "&lt;li&gt;&lt;a class=\"active\" href=\"index.php?pages={$pages['id']}\"&gt;{$pages['isim']}&lt;/a&gt;&lt;/li&gt;\n";
              }else {
               echo "&lt;li&gt;&lt;a href=\"index.php?pages={$pages['id']}\"&gt;{$pages['isim']}&lt;/a&gt;&lt;/li&gt;\n";
              }
  
          }
  echo "&lt;/ul&gt;";                   
  }
  </code></pre>
  
  <p>i show menu functions in header.php </p>
  
  <pre><code>&lt;?php 
  include 'functions.php'; 
  header_menu($_GET[page]); 
  ?&gt;
  </code></pre>
  
  <p>But no active menu when page is active</p>