title: How to replace a html div id with php function without reloading the page
body: <p>so after all the confusion here (my apologize)</p>
  
  <p>here is what I have figure I will just re-write it here and make it clear and just for the future notes (I know people won't really need this) but then will just be like a case study</p>
  
  <p>what I was actually wanted is like this example</p>
  
  <pre><code>***********************************************
  ** link1 - link2 - link3 - link4 - link5 **
  ***********************************************
  ** content here, here's the words **
  ** content here, here's the words **
  ** content here, here's the words **
  ** content here, here's the words **
  ** content here, here's the words **
  ***********************************************
  </code></pre>
  
  <p>then I found it something like this</p>
  
  <pre><code>&lt;ul&gt;
  &lt;li&gt;&lt;a href="page.php?link=1"&gt;Link 1&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="page.php?link=2"&gt;Link 2&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="page.php?link=3"&gt;Link 3&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="page.php?link=4"&gt;Link 4&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href="page.php?link=5"&gt;Link 5&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
  &lt;?php
  if(!isset($HTTP_GET_VARS['link'])){ 
      $link = 1; 
  } else { 
      $link = $HTTP_GET_VARS['link']; 
  }
  
  if ($link == 1) {
  echo "&lt;div id="player1"blah blah with video link1";
  } elseif ($link == 2) {
  echo "&lt;div id="player2"blah blah with video link2"";
  } elseif ($link == 3) {
  echo "&lt;p&gt;Some text about link 3&lt;/p&gt;";
  } elseif ($link == 4) {
  echo "&lt;p&gt;Some text about link 4&lt;/p&gt;";
  } else {
  echo "&lt;p&gt;Some text about link 1&lt;/p&gt;";
  } 
  ?&gt;
  </code></pre>
  
  <p>then @royrui clarify me that </p>
  
  <p>the solution should be like this</p>
  
  <pre><code>&lt;?php
  if(!isset($_GET['link'])){ 
      $ch = 1; 
  } else { 
      $ch = $_GET['link']; 
  }
  
  if ($link == 1) {
  echo "&lt;div id='player1'blah blah with video link1'";
  } elseif ($link == 2) {
  echo "&lt;div id='player2'blah blah with video link2'";
  } elseif ($link == 3) {
  echo "&lt;p&gt;Some text about link 3&lt;/p&gt;";
  } elseif ($link == 4) {
  echo "&lt;p&gt;Some text about link 4&lt;/p&gt;";
  } else {
  echo "&lt;p&gt;Some text about link 1&lt;/p&gt;";
  } 
  ?&gt;
  </code></pre>
  
  <p>so if you notice first thing I changed from if<code>(!isset($HTTP_GET_VARS['link'])){</code> 
   to <code>if(!isset($_GET['link'])){</code> 
    in the div all it was " so I change it to ' and now the div can be place in echo</p>
  
  <p>and now every single time when people click on link 1 then that div will be place and 2 and so on.</p>
  
  <p>I know it was my problem with the confusion questions but then I really appreciated with all the help from here.</p>
  
  <p>I want to vote the best answers but all it was useful so I just thought of put together to answer myself in this first post</p>
  
  <p>Thanks once again!</p>