3 Replies Latest reply: Mar 19, 2013 6:19 PM by battalgazigeliyor RSS

    when i click a link, to show details on same page

    battalgazigeliyor Community Member

      hi,

      I have a tabbed panel.I want to open on tab 1 details of link.For example, Navigation builder provide us page 1-2 3  on same page.like navigation builder, when users click the link it should show details on same page.( demo.php?details=link )

       

      is it possible?

       

      Note

      By the way, I am using SpryUtilis for each tab.(demo.php?tab=1)

       

      Any idea?

        • 2. Re: when i click a link, to show details on same page
          battalgazigeliyor Community Member

          Dear Gramps,

          Firstly, Thanks for reply.I figured out about tabs url.No problem.But i want to build message box(inbox,outbox) on a tab.When i click message title in inbox or outbox, i need see message detail same page.My problem is as i said.Have you any idea?

          Thanks...

          • 3. Re: when i click a link, to show details on same page
            battalgazigeliyor Community Member

            i found this tutorial.But i have already myprofile?tab=0,1,2 url additional.in this tutorial too it' addin url's end "?navig=home".How will be mine? is it look like: myprofile.php?tab=2?navig=home.Is it possible?Please help me.

             

            Introduction

            In general, a menu is a list of items. A menu is presented as a group of audible choices to which the user can respond by pressing a button or speaking aloud. A menu is a group of options presented to the user of a computer to help the user get information about any program or application. Menus are commonly used in graphical user interfaces such as Windows.

            The item of a menu is like the point on the map that says "you are here".

            A menu is a set of commands or options from which you can select your choice. You can select an item from the menu by highlighting it and then pressing enter or by simply pointing to the item and clicking the mouse button.

            There are many types of menus, some of them are:

            • Pop-up menu: A pop-up menu has only two choices i.e. Yes/No, that is called a dialog box. Once you make a selection from a pop-up menu, the menu usually disappears.
            • Cascading menu: A submenu that opens when you choose a choice from another menu.
            • Pull down menu: A pull-down menu like selecting an item from a combo box. A special type of pop-up menu that appears directly beneath the command you selected.
            • Dynamic navigation menu: A dynamic menu is a way to give users a reference point with which to navigate.

            A dynamic menu with scrolling color glide following is appropriate for a personal entertainment blog and a website which requires new fashioned style and personalization.

            First of all we will create menu.php file.

            Code

            <?php
            function menu_item ($id, $title, $current)
            {
              $class = ($current == $id) ?
            "active" : "inactive";
            ?>
              <tr><td class=<?=$class?>>
              <a href="index.php?page=<?=$id?>"><?=$title?></a>
              </td></tr>
            <?php
            }
            function page_menu ($page)
            {
            ?>
              <table width="100%">
              <?php menu_item ('Home', 'Home', $page); ?>
              <?php menu_item ('About', 'About', $page); ?>
              <?php menu_item ('Browse', 'Browse', $page); ?>
              <?php menu_item ('Download', 'Download', $page); ?>
               <?php menu_item ('Contact Us', 'Contact Us', $page); ?>
            </table>
            <?php
            }
            ?>

            The above file is to be saved with the name menu.php, which will be called from the index.php file later.

            Now we will create another file in PHP, named index.php. In this file the menu.php file is called.

            <?php
            include_once ('menu.php');
            $page =
            isset($_GET['page']) ? $_GET['page'] : 'Home';
            ?>
            <html>
            <
            head>
            <
            title>Page - <?=$page?></title>
            <
            style type="text/css">
            .inactive, .active
            {
            padding:2px 2px 2px 20px;
            }
            .inactive
            {
            background:skyblue
            }
            .active
            {
            background:red;
            font-weight:bold;
            }
            .inactive a
            {
            text-decoration:none;
            }
            .active a
            {
            text-decoration:none;
            color:white;
            }
            </style>
            </
            head>
            <
            body bgcolor="pink">
            <h3><u>Dynamic Navigation Menu</u></h3>
            <
            table>
            <
            tr>
            <
            td width="200" valign="top">
            <?php page_menu($page); ?>
            </td>
            <
            td width="600" valign="top">
            Page: <?=$page?>
            </td>
            </
            tr>
            </
            table>
            </
            body>
            </html>

            Output

            When you will browse your index.php file then you will get the following image. When you click on home then the background of the home will be red and the message "Page : Home" will be printed.

            image1.jpg

            When you click on about then the background of about will be red and the message "Page : About" will be printed.

            image2.jpg

            In the same manner, when you will click on browse, download or contact us then the background of these items will be red and "Page : Browse", "Page : Download" or "Page : Contact Us" respectively, will be printed.

            image5.jpg

            Conclusion

            So in this article you saw, how to create a dynamic navigation menu in PHP. Using this article one can easily understand the concept of a dynamic navigation menu in PHP.