Beste allemaal,
Ik heb een mini cms gebouwd voor mijn website, alleen nu wil ik een dropdown menu toevoegen.
Dit drop down menu wordt een nieuw template en hij haalt hiermee gegevens op uit de database.
Zie mijn dropdown:
http://onlinepchelp.nl/testcms/template/
Ik heb bijvoorbeeld categorie Bart. Hierin zijn 2x een pagina gekoppeld: testtest 1 en testtest2.
De eerste zet hij er wel netjes onder in dropdown zoals je kan zien bij die link, maar de tweede niet.
Wat doe ik fout??
Mijn code is:
Oja, hij heeft in instellingen.php wat bovenaan geinclude is zijn mysql gegevens. (voordat iemand hier mee komt).
Ik heb een mini cms gebouwd voor mijn website, alleen nu wil ik een dropdown menu toevoegen.
Dit drop down menu wordt een nieuw template en hij haalt hiermee gegevens op uit de database.
Zie mijn dropdown:
http://onlinepchelp.nl/testcms/template/
Ik heb bijvoorbeeld categorie Bart. Hierin zijn 2x een pagina gekoppeld: testtest 1 en testtest2.
De eerste zet hij er wel netjes onder in dropdown zoals je kan zien bij die link, maar de tweede niet.
Wat doe ik fout??
Mijn code is:
Code:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>handy-HTML.com - Create a simple CSS dropdown menu</title>
<style type="text/css">
ul {
font-family: Arial, Verdana;
font-size: 14px;
margin: 0;
padding: 0;
list-style: none;
}
ul li {
display: block;
position: relative;
float: left;
}
li ul {
display: none;
}
ul li a {
display: block;
text-decoration: none;
color: #ffffff;
border-top: 1px solid #ffffff;
padding: 5px 15px 5px 15px;
background: #1e7c9a;
margin-left: 1px;
white-space: nowrap;
}
ul li a:hover {
background: #3b3b3b;
}
li:hover ul {
display: block;
position: absolute;
}
li:hover li {
float: none;
font-size: 11px;
}
li:hover a { background: #3b3b3b; }
li:hover li a:hover {
background: #1e7c9a;
}
</style>
</head>
<?php
include ('../instellingen.php');
?>
<body>
<ul id="menu">
<li><a href="#">Homepage</a></li>
<li><a href="#">Nieuws</a></li>
<?php
$sql = mysql_query("SELECT * FROM cat ORDER BY volg ASC");
while($row = mysql_fetch_array($sql)){
if ($row['actief'] == 'ja') {
?>
<li><a href="#"><?php echo $row['cat_naam']; ?></a>
<?php
$sql1 = 'SELECT * FROM pagina WHERE cat="'.$row['cat_id'].'" ORDER BY volg ASC';
$sql2 = mysql_query($sql1) OR die (mysql_error());
while($rows = mysql_fetch_array($sql2)){
if ($rows['actief'] == 'ja') {
$title = str_replace(' ','-','' . $rows['titel'] . '');
?>
<ul>
<li><a href="#/<?php echo $rows['pagina_id']; ?>/<?php echo $title; ?>/"><?php echo htmlentities($rows['titel']); ?></a></li>
</ul>
</li>
<?php
}}}}
?>
<li><a href="#">Contact</a></li>
</ul>
<a href="<?php echo $siteurl; ?>pagina/<?php echo $rows['pagina_id']; ?>/<?php echo $title; ?>/"><?php echo htmlentities($rows['titel']); ?></a>
</body>
</html>
Oja, hij heeft in instellingen.php wat bovenaan geinclude is zijn mysql gegevens. (voordat iemand hier mee komt).
