PDA

View Full Version : <a name""> redirect via php


Roost3r
08-31-2002, 11:26 PM
I have links on my main page from my mysql database; the links are like this blabla.php?id=1 how can i get them to center on the news topic in the blabla page?

mordred
09-01-2002, 12:10 AM
:confused:

You mean with "center" to let the browser scroll directly to the desired news topic? Then you have to include the anchor name/id of the news topic in the link itself, i.e:

<a name="topic1234">blabalds.df.asf

Then you have

<a href="blabla.php?id=1#topic1234">

This means however that you need to know the actual anchor name. But since it seems that you use the id parameter to uniquely identify a news topic, it would make sense to name the anchors likewise, perhaps like topic1, topic2, etc... you get the idea.

Roost3r
09-01-2002, 12:18 AM
thats exactly what i want to do; i have it coded right but it still doesnt go to where it should on that page

im using my primary key as the # to go to

errr nm i got it; thanks; im a moron :)

mordred
09-01-2002, 12:23 AM
Have you tried calling the URL by typing it in the browser's location bar? If it doesn't work correctly, than the problem lies most probably in the page with the anchor.

Remember that if the page's content does not extend far enough down the page, you won't see any scrolling effect, because there's no more space to scroll at all.

If you still can't figure this out, best it would be to put an example on the web so we can check that in return.

EDIT: Ah well... you've got it. :)