Hey all I’m trying to create this navbar tutorial [url]http://line25.com/tu…s-dropdown-menu
This is the php inside my nav.php:
[code=php]<?php
echo ‘<div id=”nav”>’;
$whatpage = basename($_SERVER[‘PHP_SELF’]);
echo ‘<ul>’;
echo ‘<li>’;
if ($whatpage == ‘index.php’) {
echo ‘<a href=”index-1.php” class=”highlight”>home</a>’;
} else {
echo ‘<ahref=”index-1.php”>home</a>’;
}
echo ‘</li>’;
echo ‘<li>’;
if ($whatpage == ‘portfolio.php’ || or ’17.bedf.php’ || or ’12cur.php’ || or ‘bhl.php’ || or ‘alb.php’ || or ‘5yeo.php’ || or ’96hsk.php’ || or ’11lgm.php’ || or ’12hon.php’ || or ’62elswt.php’) {
echo ‘<a href=”portfolio.php class=”highlight”>portfolio</a>’;
} else {
echo ‘<a href “portfolio.php”>portfolio</a>’;
}
echo ‘<ul>’;
echo ‘<li>traditional stairs’;
echo ‘<ul>’;
echo ‘<li><a href=”17.bedf.php”>concrete stairs – covent garden</a></li>’;
echo ‘<li><a href=”12cur.php”>rc stairs – mayfair</a></li>’;
echo ‘<li><a href=”bhl.php”>half landing concrete stairs</a></li>’;
echo ‘<li><a href=”alb.php”>non slip concrete treads – london bridge</a></li>’;
echo ‘<li><a href=”5yeo.php”>concrete stairs – knightsbridge</a></li>’;
echo ‘</ul>’;
echo ‘</li>’;
echo ‘</ul>’;
echo ‘<li>complex concrete stairs’;
echo ‘<ul>’;
echo ‘<li><a href=”96hsk.php”>spiral concrete stairs – kensington</a></li>’;
echo ‘<li><a href=”11lgm.php”>curved concrete staircase – battersea</a></li>’;
echo ‘<li><a href=”62elswt.php”>helical concrete stairs – st johns wood</a></li>’;
echo ‘</ul>’;
echo ‘</li>’;
echo ‘</ul>’;
echo ‘</ul>’;
echo ‘</div>’;
?>
Validator checks are showing an error on line 16 (the one with many conditions seperated by double pipe characters ||.
As it stands live at: [URL=”http://www.concretes….uk/index-1.php”]http://www.concretes….uk/index-1.php
[/URL]
I haven’t messed around with css formatting at all yet (apart from class=”highlight” mainly) but I seem to completely mess up my page when I’m trying to load it.
I have an index.php which uses <?php
include(‘nav.php’);
?> to bring the navbar into the index page.
My list is live at [URL=”http://www.concretes…complex-ul.html”]http://www.concretes…complex-ul.html[/URL] just incase I have missed anything; here is the html5 that is on that url:
[code=html]<div id=”nav”>
<ul>
<li><a href=”index.php”>home</a></li>
<li><a href=”concrete stairs.php”>concrete stairs</a>
<ul>
<li>traditional stairs
<ul>
<li><a href=”17.bedf.php”>concrete stairs – covent garden</a></li>
<li><a href=”12cur.php”>rc stairs – mayfair</a></li>
<li><a href=”bhl.php”>half landing concrete stairs</a></li>
<li><a href=”alb.php”>non slip concrete treads – london bridge</a></li>
<li><a href=”5yeo.php”>concrete stairs – knightsbridge</a></li>
</ul>
</li>
<li>complex concrete stairs
<ul>
<li><a href=”96hsk.php”>spiral concrete stairs – kensington</a></li>
<li><a href=”11lgm.php”>curved concrete staircase – battersea</a></li>
<li><a href=”62elswt.php”>helical concrete stairs – st john’s wood</a></li>
</ul>
</li>
</ul>
</ul>
</div>
Greatful for any advice, as I’m close but yet so far.