I've had a lot of help on another forum and I'm a bit stuck so seeing if anyone here can help (I'm on the ponce again
) I have an <ul> as my nav bar, and I am using php to check whether page is the last url piece after the /.
I had it almost working (colours wasn't changing yet) but at least I had my page loading, instead of disapeering completely. I have now turned on to display php errors. I am not sure what the problem is now, I have edited a lot and not sure what's causing it. The reason I carried on editing is that it was creating formatting issues with my css. The list was set up nicely displaying even gaps, and flush at both ends, however when I finally got my php to work it pushed it along and messed it up.
Surely php shouldn't have created any formatting errors as I'm only using it to display html on the page. So something has gotta be up with my code, can anyone see anything obvious. I have left the <div>'s in so you can get a feel of how it is set up:
PHP errors are showing on line
underneath services, though I cannot see why as it is the same as its predeccessor.
I had it almost working (colours wasn't changing yet) but at least I had my page loading, instead of disapeering completely. I have now turned on to display php errors. I am not sure what the problem is now, I have edited a lot and not sure what's causing it. The reason I carried on editing is that it was creating formatting issues with my css. The list was set up nicely displaying even gaps, and flush at both ends, however when I finally got my php to work it pushed it along and messed it up.
Surely php shouldn't have created any formatting errors as I'm only using it to display html on the page. So something has gotta be up with my code, can anyone see anything obvious. I have left the <div>'s in so you can get a feel of how it is set up:
PHP:
<div id="nav">
<ul id="nav-list">
<?php
$scriptname = end (explode('/',_FILE_));
echo '<li>';
if ($scriptname == 'index.php') {
echo '<a href="index.php" class="highlight">home</a>';
} else{
echo '<a href="index.php">home</a>';
}
echo '</li>';
echo '<li>';
if ($scriptname == 'services.php'); {
echo '<a href="services.php" class="highlight">services</a>';
} else{
echo '<a href="services.php">services</a>';}
echo '</li>';
echo '<li>';
if ($scriptname == 'portfolio.php'); {
echo '<a href="portfolio.php" class="highlight">portfolio</a>';
} else{
echo '<a href="portfolio.php">portfolio</a>';}
echo '</li>';
echo '<li>';
if ($scriptname == 'links.php'); {
echo '<a href="links.php" class="highlight">links</a>';
} else{
echo '<a href="links.php">links</a>';}
echo '</li>';
echo '<li><a href="http://www.preciseformwork.co.uk/wordpress">blog</a>';
echo '<li>';
if ($scriptname == 'contact.php'); {
echo '<a href="contact.php" class="highlight no-pad">contact us</a>';
} else{
echo '<a href="contact.php" class="no-pad">contact us</a>';}
echo '</li>';
?>
</ul>
</div>
PHP:
} else {