Page 1 of 1

PHP Navigation Menu works in FF but issues in IE

Posted: Wed Aug 08, 2007 11:27 am
by the9ulaire
Here's my code:

Code: Select all

$return = array();
while ($row = mysql_fetch_array($result)) {
  $return[] = "<a href=\"index.php?p=" . $row['page_id'] . "\" title=\"" . $row['page_desc'];
  if (isset ($_GET['p'])
  		and ($_GET['p']) == $row['page_id']) {
  	$return[] .= "\" id=\"activelink\""; 
  } else if (!isset ($_GET['p'])
  	and $row['page_id'] == 2) {
  		$return[] .= "\" id=\"activelink\""; 
  }
  $return[] .= "\">". $row['page_name'] ."</a>";
}

echo implode(' | ', $return);
It works perfectly in Firefox, but when I check it in IE, it acts quite odd. Any ideas?

Thanks guys!
Luke

Posted: Wed Aug 08, 2007 12:16 pm
by volka
odd? Please elaborate.

Posted: Wed Aug 08, 2007 12:24 pm
by the9ulaire
Oh, sorry, I didn't post a link: http://lwrussell.com/phptesting/cms/

Take a look at it in FF, that's what I want it to look like. IE butchers it.

Posted: Wed Aug 08, 2007 12:47 pm
by volka
Your code prints
<a href="index.php?p=2" title="Home Page of CMS " id="activelink" | ">Home</a>
What's the red code supposed to do? In any case that's what's causing the problem in the IE.

Posted: Wed Aug 08, 2007 1:44 pm
by the9ulaire
Ahhh, I found the problem. Thanks for pointing that out.

All I had to do was switch around some double quotes.

Thanks again!
Luke