Client Side Coding > HTML & CSS

Dynamic menu

(1/1)

revolt:
I am making a webpage using php, html and css. I have one start page and from this using if and include to go to other pages like this:

Navigation:

--- PHP Code: --- <li><a href="index.php?page=intro">Intro</a></li>
<li><a href="index.php?page=worldwide">WorldWide travels</a></li>
<li><a href="index.php?page=japan2011">Japan: Tokyo 2011</a></li>
<li><a href="japan2012.php">Japan: IUJ 2012</a></li>

--- End code ---

Include part:

--- PHP Code: --- <?php
if($_GET['page'] == "intro"){include('intro.php');}
else if($_GET['page'] == "om"){include('om.php');}
else if($_GET['page'] == "worldwide"){include('worldwide.php');}
else if($_GET['page'] == "japan2011"){include('japan2011.php');}
else{include('intro.php');}
?>

--- End code ---

As you can see, one of the links are leading to japan2012.php, because I on this page have another meny using includes. However, on this page, the includes that are a part of the if-statements are not shown.

The codes are:

--- PHP Code: --- <a href="japan2012.php?page=var">VĂ¥rsemesteret (april-juni)</a> <br />
<a href="japan2012.php?page=spring">Spring break</a> <br />
<a href="japan2012.php?page=vinter">Vintersemesteret (januar-mars)</a> <br />
<a href="japan2012.php?page=bakgrunn">Bakgrunnsinformasjon om oppholdet</a> <br />

--- End code ---

and

--- PHP Code: --- <?php
if($_GET['page'] == "var"){include('japan2012_innlegg/varsemester.php');}
else if($_GET['page'] == "spring"){include('japan2012_innlegg/springbreak.php');}
else if($_GET['page'] == "vinter"){include('japan2012_innlegg/vintersemester.php');}
else if($_GET['page'] == "bakgrunn"){include('japan2012_innlegg/bakgrunn.php');}
else{include('japan2012_innlegg/varsemester.php');}
?>

--- End code ---

Can anyone understand this problem? Or is there another way of doing it when you have a second meny in on of the parts that are dynamic, having a second dynamic area?

Thank you in advance for helping.

richei:
is the second menu on the japan page or the index page? the second menu php code has to be on the page that you went to - in this case, japan2011.php.

revolt:
Thank you richei, I solved it eventually. It was on the right page, so I don't know what the real problem was.

Navigation

[0] Message Index

Go to full version