Click to See Complete Forum and Search --> : PHP menu problem in internet exporer


dominicbell
09-29-2008, 08:24 AM
Hi There!

I have a really annoying PHP problem which is driving me crazy.

I have just finished this site:

www.shape-studio.co.uk

which uses some simple php for the projects menu. here's the menu file:

www.shape-studio.co.uk/text/menu.php

The color of the 'current' link is highlighted white when on that page. Each page has a php marker on it, e.g <?php $thisPage="maps"; ?>

This works perfectly in Firefox and Safari, but doesn't work in Internet explorer. The links don't even work, let alone being highlighted!!!!

HELP PLEASE!!!


thanks
Dominic

Fang
09-29-2008, 09:56 AM
No DTD and the menu list is malformed.
<div id="navigation">
<u>Projects</u><br/>

<br/>


<li id="currentpage"<a href="ianparry.php" class="menustyle" id="ianparry">Ian Parry invitation 2008</a></li><br/>

<li<a href="maps.php" class="menustyle" id="maps">Redefining London maps</a></li> <br/>

<li<a href="clusters.php" class="menustyle" id="clusters">Creative Clusters</a></li> <br/>

<li<a href="mnemonics.php" class="menustyle" id="mnemonics">Mnemonics</a></li> <br/>

<li<a href="ma07.php" class="menustyle" id="ma07">MA07</a></li> <br/>

<li<a href="showoff.php" class="menustyle" id="showoff">Show Off</a></li> <br/>

<li<a href="10.php" class="menustyle" id="ten">10</a></li> <br/>

<li<a href="showandtell.php" class="menustyle" id="showandtell">Show & Tell</a></li> <br/>



</div>

dominicbell
09-29-2008, 11:13 AM
Hi fang, great, thanks for that. Can't test it until this evening though. How come it works ok in safari and firefox? Do you know?

Should I put the same DTD in this file as in my index file? Also, should I place this DTD at the top of everypage on my site?

Thanks!
Dom

Fang
09-29-2008, 11:22 AM
How come it works ok in safari and firefox? Do you know?All browsers try to correct the errors in the document. If they didn't do this 90% of web pages would break.

The DTD (http://www.w3.org/QA/Tips/Doctype) always at the top of the page. Go for html 4.01 strict

Even after these corrections, there may still be problems.

SyCo
09-29-2008, 01:17 PM
Just a foot note to this. PHP isn't browser dependent CSS and HTML are so if you hit a problem that is only occurring in a particular browser you can bug hunt by looking straight at the HTML. The error might what PHP is outputting but you'll see it more clearly if you examine the source of the page.

opifex
09-29-2008, 02:20 PM
SyCo and Fang are right on the mark....
1. choose and declare the DTD that fits your design
2. ensure that the php or other server side language (or javascript client side!) is outputting the elements in accordance with the DTD.

the example mixes html and xhtml tag closing styles... and is declared as XHTML 1.0 Strict.