Navigation Bars help

Discussion in 'PHP' started by ji394su30935, Jun 18, 2010.

  1. #1
    this problem should be easy as hell yet I have no idea how to solve it.

    Brief Description:[/COLOR]
    my web page has two navigation bars. One of them is navigating the main content; the other one is navigating the news content.

    Problem:
    whenever I called content in main, the content in news will disappear.
    Whenever I called the content in news, the content in main will disappear.

    My code:
    I am using this method to call my content:

    <?php//in the main section
    if (!isset($_REQUEST['content']))
    include("primary.inc.php");
    else
    {
    $content = $_REQUEST['content'];
    $nextpage = $content . ".inc.php";
    include($nextpage);
    }
    ?>

    <?php//in the news section
    if (!isset($_REQUEST['news']))
    include("secondary.inc.php");
    else
    {
    $content = $_REQUEST['news'];
    $nextpage = $content . ".inc.php";
    include($nextpage);
    }
    ?>

    Possible Solution:

    1. should I create some kind of memory to memorize the content of each "main" and "news"?
    2. or there is a better way to solve this problem.


    Can anyone help me please?
    Thank you so MUCH!
     
    ji394su30935, Jun 18, 2010 IP
  2. flexdex

    flexdex Peon

    Messages:
    104
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Make sure that content and news always set at the url or write the last news or main page to $_SESSION (may read about session handling at www.php.net) and take that to your !isset conditions.
     
    flexdex, Jun 19, 2010 IP
  3. roopajyothi

    roopajyothi Active Member

    Messages:
    1,302
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    80
    #3
    Could you provide me the working URL?
     
    roopajyothi, Jun 20, 2010 IP
  4. ji394su30935

    ji394su30935 Peon

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Everything is coded in WAMP sever, so I don't have URL for u.
    Do you have any preference that I can help you to see my code/web-page?

    Thank you so much for responding to my concern.
     
    ji394su30935, Jun 20, 2010 IP