Jump to content


Photo

problem with named anchors


  • Please log in to reply
1 reply to this topic

#1 vzwhaley

vzwhaley
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 28 February 2006 - 03:20 AM

Hello everyone and thanks much for your past help.

I am wanting to pull two records from a database and give each of them a named anchor link based on a number, such as $i = 0; and increment that number for each record. In other words, the first named anchor would be #0 and the second one would be #1, and so on.

I can't seem to get this to work with the following code. Any tips or suggestions would be greatly appreciated.

do {

for ($i = 0; $i <= 1; $i++) {
            echo "<b><a href=#".$i." class=\"TopStories\">".$RSMiddle2['Title']."</a></b><br>";
}
 } while ($RSMiddle2 = mysql_fetch_array($Recordset2));


#2 khburres

khburres
  • Members
  • PipPip
  • Member
  • 12 posts

Posted 02 March 2006 - 04:20 PM

[!--quoteo(post=350128:date=Feb 27 2006, 10:20 PM:name=vzwhaley)--][div class=\'quotetop\']QUOTE(vzwhaley @ Feb 27 2006, 10:20 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
echo "<b><a href=#".$i." class=\"TopStories\">".$RSMiddle2['Title']."</a></b><br>";
[/quote]

try including quotation marks:
echo '<b><a href="#' . $i . '" class...</a>';

Also, do you have the actual anchors somewhere in your html?
i.e., do you have corresponding <a name="1"></a>, <a name="2"></a>?

He who guards his mouth and his tongue keeps himself from calamity.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users