Jump to content

php / mysql -jump to list


deathgame3

Recommended Posts

hi so simple i have a plain list of link which is really long, there are about 400 links, this is the php code used to display them:

<a href="<?php echo $category->link; ?>" class="category"><?php echo $category->title;?></a> they are gained thru mysql, now since the list is really long, i want to create a jump list for it(to jump to all links starting wid A,B,C,D..etc) similar to here:

 

now to do tht i know first i wud have to do this: <a href="#a">A</a> then i wud have to place <a name="a"> before the first link starting wid A...and similar for the rest of the characters....but the problem is tht the list is displayed using php wid only this code:

<a href="<?php echo $category->link; ?>" class="category"><?php echo $category->title;?></a>

 

so i dont know where i shud put <a name="a"> etc....cuz i dont see the list tht means i cannot edit it :\ so please all help is appreciated!

Link to comment
https://forums.phpfreaks.com/topic/150238-php-mysql-jump-to-list/
Share on other sites

  • 2 weeks later...

You can put the name tag at just before the href portion such as:

 

<a name="a" href="<?php echo $category->link; ?>" class="category"><?php echo $category->title;?></a>

 

You'll need to use some login to determine which letter to use for the name tag, and to determine if its the first tag that begins with that letter, because you won't want a number of anchor's with the same name

 

 

Joe Ceresini

Network Engineer

[email protected]

HostMySite.com

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.