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
the9ulaire
Forum Commoner
Posts: 74 Joined: Mon Jun 11, 2007 11:31 am
Post
by the9ulaire » Wed Aug 08, 2007 11:27 am
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
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Wed Aug 08, 2007 12:16 pm
odd? Please elaborate.
volka
DevNet Evangelist
Posts: 8391 Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger
Post
by volka » Wed Aug 08, 2007 12:47 pm
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 » Wed Aug 08, 2007 1:44 pm
Ahhh, I found the problem. Thanks for pointing that out.
All I had to do was switch around some double quotes.
Thanks again!
Luke