Firefox Multiple Link Tags Problem

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
HiddenS3crets
Forum Contributor
Posts: 119
Joined: Fri Apr 22, 2005 12:23 pm
Location: USA

Firefox Multiple Link Tags Problem

Post by HiddenS3crets »

I have a code snippet that looks like this:
[text]<div class='social_block'>
<a href='twitter.com...'>
<img src='twitter_image...' />
<p><? echo get_num_followers(); ?></p>
<p>followers</p>
</a>
</div>

<div class='social_block'>
<a href='facebook.com...'>
<img src='facebook_image...' />
<p><? echo get_num_likes(); ?></p>
<p>likes</p>
</a>
</div>[/text]
* get_num_followers() and get_num_likes() both return a number

The issue is that (and I've only noticed this in firefox so far) each line inside the <a> get's wrapped inside it's own <a> tag so the rendered source looks like this:
[text]<div class='social_block'>
<a href='twitter.com...'><img ... /></a>
<p><a href='twitter.com...'>150</a></p>
<p><a href='twitter.com...'>followers</a></p>
</div>[/text]

What's interesting, though, is that if I replace the PHP code with just a number, it renders on the page ok
[text]i.e. i replaced
<p><? get_num_followers(); ?></p>
with
<p>150</p>[/text]
I cannot figure out why the PHP code is causing rendering issues here... any ideas on a fix for this?
Post Reply