How can i display to link to my Div

Is this possible,i have 2 divs,in leftside and in right side,in my leftside Div i have 3 links as my menu and i want that if i want to click on each link it will load to my second Div which is in Right side Div.i hope someone help me on this.
I a confuse.

Thank you in advance.

Please show the code that you have already tried.

>>> i want to click on each link it will load to my second Div which is in Right side Div.

What is “it” that you want to load into the right-hand div?


<div id="menu">	
		<ul>
		    <li class="header">My Menu</li>
		  <li><a href="page1.php"><span>search by name <span></a></li>
		 <li><a href="page2.php"><span>search by fname<span></a></li>
		  <li><a href="page3.php"><span>search by age<span></a></li>
									
		</ul>
 </div>	



This second div is on the right side of it.
when i click the link i want that it will load to the right side of my div.I am still beginner on this php and i have no idea on how to do this.I hope you can share and help me.Thank you in advance.


<div id="content">
 load content here.
</div>

How do i load the pa


<div id="menu">	
		<ul>
		    <li class="header">My Menu</li>
		  <li><a href="page1.php"><span>search by name <span></a></li>
		 <li><a href="page2.php"><span>search by fname<span></a></li>
		  <li><a href="page3.php"><span>search by age<span></a></li>
									
		</ul>
 </div>	



This second div is on the right side of it.
when i click the link i want that it will load to the right side of my div.I am still beginner on this php and i have no idea on how to do this.I hope you can share and help me.Thank you in advance.


<div id="content">
 load content here.
</div>

How do i load the pa

Try this:


// _menu.php _prefix to show include and only part of a page
$a=array
{
  'index.php?page=name'   => 'search by name',
  'index.php?page=fname'  => 'search by fname',
  'index.php?page=age'    => 'search by age',
}
echo "<ul>";
  foreach($a as $url => $item)
  {
    echo '<li>';
      echo "<a href='" .$url ."'><span>" .$item .'<span></a>';
    echo '</li>';
  }
echo '</ul>';


and your main page:



// index.php
<html>
  <...header/title/css/etc...>
<body>
<div id='outer'>

  <div id='menu'>
    <?php include '_menu.php';?>
  </div>

  <div id='content'
    <?php
      $inc_page = isset($_GET['page']) ? $_GET['page'] : 'blurb';
      if( ! file_exists( $inc_page ) )
      {
        $inc_page = 'blurb';
      }
      include '_' .$inc_page .'.php';
    ?>
  </div>

  <div id='footer'>
    <?php include '_footer.php';?>
  </div>

</div?<?php /* outer */ ?>
<body>
</html>

Hi, Thank you for the reply,can i ask what does blurb means is that a page?

Sllghtly modifed so it should now work :slight_smile:



    $inc_page = isset($_GET['page']) ? $_GET['page'] : 'blurb';
    $inc_page = '_'  . $inc_page . '.php';
    if( ! file_exists( $inc_page ) )
    {
        $inc_page = '_blurb.php'; // default $inc_page 
    }
    include $inc_page;
    ?>

The $inc_page gets the $_GET[‘page’] variable.

Example:
index.php?page=name OR index.php?page=fname OR index.php?page=age

The $inc_page is tested to see if it exists. If it does then the $inc_page is included ELSE ‘_blurb.php’ is included.

Wiki:
A blurb is a short summary accompanying a creative work; the word was coined in 1907 by American humorist Gelett Burgess. It may refer to the text on the back of a book but can also be seen on DVD and video cases, web portals and news websites. A blurb may introduce a newspaper or magazine feature story.

Thank you so much i will give a try on this.