Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Jumping" to an anchor

Status
Not open for further replies.

LaundroMat

Programmer
Dec 2, 2003
67
0
0
BE
Suppose I have an HTML file with a few anchors in it.

Now also suppose that I get the url "main.php?anchor=part_two" instead of "main.php#part_two".

What would be the best way to translate the GET data into an anchor, and make the browser "jump" to the part of the page intended?
 
instead of attaching the "part_two" as an attribute in the URL
why not just write the link dynamically using the data stored in the variable "part_two"


Something like

Code:
<a href="newPage.php#<?=$part_two;?>">My anchored Link</a>

This is more a PHP question than an HTML one.

- Web design and ranting
- Day of Defeat gaming community
"I'm making time
 
Well, that's how the link is constructed. I also wanted to dynamically switch between anchors and includes.

I've found a way, through javascripting window.location().

It's true that the thread isn't the best placed in this forum though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top