I have a little trouble wih getting the page=? value and use that value to retrieve content according to the correct page. Currently this code just keeps getting stuck at the home page, even whenever I try to open something as the " Languages " tab.
Would love some help..
<?php
session_start();
if( isset( $_GET["page"]) ) {
$_SESSION["activePage"] = $_GET["page"];
}
if( !isset( $_GET["activePage"] ) ) {
$_SESSION["activePage"] = "home";
}
?>
This is my PHP code
<div id="cs_menu">
<ul class="ul_menu">
<li><a href="?page=home">Home</a></li>
<li><a href="?page=languages">Languages</a>
<ul>
<li><a href="?page=dutch">Dutch</a></li>
<li><a href="?page=german">German</a></li>
<li><a href="?page=french">French</a></li>
<li><a href="?page=spanish">Spanish</a></li>
</ul>
</li>
<li><a href="&page=dialecten">Dialecten</a>
<ul>
<li><a href="?page=twents">Twents</a></li>
<li><a href="?page=fries">Fries</a></li>
<li><a href="?page=zachteg">Zachte G</a></li>
<li><a href="?page=rotterdams">Rotterdams</a></li>
<li><a href="?page=amsterdams">Amsterdams</a></li>
</ul>
</li>
<li><a href="?page=provincies">Provincies</a>
<ul>
<li><a href="?page=overijssel">Overijssel</a></li>
<li><a href="?page=noordholland">Noord-Holland</a></li>
<li><a href="?page=gelderland">Gelderland</a></li>
</ul>
</li>
</ul>
</div>
This is my HTML menu
<div id="content">
<?php
echo $_SESSION["activePage"];
include "includes/".$_SESSION["activePage"].".phtml";
?>
</div>
Here I am calling the content
issue with $_GET parameter
<?php
session_start();
if( isset( $_GET["page"]) ) {
$_SESSION["activePage"] = $_GET["page"];
}
if( !isset( $_GET["page"] ) ) {
$_SESSION["activePage"] = "home";
}
?>
Mentioin Full url in href. As you gave href="?page=twents" it will try to open "?page=twents" and will get stuck.