Help - Search - Members - Calendar
Full Version: How do you include BOTH an anchor and a parm in a link?
HTMLHelp Forums > Programming > Server-side Scripting
Mark Wilson
First off, I'm not sure if this is a client-side or server-side issue, so I'm gonna try both places - sorry!

I have a file, news.php, which generates a page based on the parameter "issue" which is sent from a link.
Example:
a href="news.php?issue=26"

So far, all well and good. BUT... I want to be able to link to anchors which are in that page, anchors which correspond to individual articles.
If the page were static, or at least didn't need the "issue" parameter, I could say:
a href="news.php#articleId77" and I'd get the right page, scrolled to anchor "articleId77".

BUT... how do I COMBINE them?
I've tried "news.php?issue=26#articleId77", and of course the program can't find the "issue" parameter.
I've tried "news.php#articleId77?issue=26", same result.

I could make the articleId a regular parameter, but then I don't know how to scroll to it automatically, as the "#anchorRef" option does so nicely. Help!
Darin McGrew
QUOTE(Mark Wilson @ Mar 1 2007, 03:02 PM) *
BUT... how do I COMBINE them?
I've tried "news.php?issue=26#articleId77", and of course the program can't find the "issue" parameter.
That's odd. The server-side program shouldn't see the #articleId77 part at all. The browser should request news.php?issue=26 from the server and then go to id="articleId77" (or name="articleId77") on its own.
Mark Wilson
QUOTE(Darin McGrew @ Mar 1 2007, 06:27 PM) *

QUOTE(Mark Wilson @ Mar 1 2007, 03:02 PM) *
BUT... how do I COMBINE them?
I've tried "news.php?issue=26#articleId77", and of course the program can't find the "issue" parameter.
That's odd. The server-side program shouldn't see the #articleId77 part at all. The browser should request news.php?issue=26 from the server and then go to id="articleId77" (or name="articleId77") on its own.

mad.gif OK, I apologize to all. I tried it again, just as I showed it here, and this time it worked. Beats me what the problem was, but undoubtedly some sort of operator error. Foo.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.