PHP Navigation Menu works in FF but issues in IE

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
the9ulaire
Forum Commoner
Posts: 74
Joined: Mon Jun 11, 2007 11:31 am

PHP Navigation Menu works in FF but issues in IE

Post 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
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

odd? Please elaborate.
the9ulaire
Forum Commoner
Posts: 74
Joined: Mon Jun 11, 2007 11:31 am

Post 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.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post 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.
the9ulaire
Forum Commoner
Posts: 74
Joined: Mon Jun 11, 2007 11:31 am

Post 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
Post Reply