Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 23rd, 2005, 02:36 PM
Registered User
 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to SignalFade
Default anchor and get variables.

Hey,

I'm trying to set get variables and an anchor tag at the same time. Can this be done?

I have a link that is being clicked which has GET values added at the end. The anchor is also there.

example:
http://www.mydomain.com/index.php#bo...able=something

the page reloads but doesn't then automatically move down to the anchor tag with the name "bottomofpage". Is there something I'm doing wrong or does this not work?

thanks
walker
 
Old January 24th, 2005, 04:35 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Reverse the URL like this:

http://www.mydomain.com/index.php?va...g#bottomofpage

-Snib - http://www.snibworks.com
Where will you be in 100 years?
 
Old January 24th, 2005, 04:40 PM
Registered User
 
Join Date: Jan 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to SignalFade
Default

Thanks!!!!
 
Old January 18th, 2006, 12:13 PM
Registered User
 
Join Date: Jan 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Actually, this is an invalid solution. The HTML standard does not support using both named anchors and GET variables at once. Your 'solution' works in IE, but in no other browser on earth.
 
Old January 19th, 2006, 08:56 PM
Friend of Wrox
 
Join Date: Jan 2006
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by synosure
 Actually, this is an invalid solution. The HTML standard does not support using both named anchors and GET variables at once. Your 'solution' works in IE, but in no other browser on earth.
Synosure,

I don't know where you came up with this idea. The composition of URLs is not defined in the HTML standard -- it is defined in the RFC for Uniform Reference Identifiers, which can be found here: http://www.ietf.org/rfc/rfc3986.txt

Inside this specification, you will find that URLs have the following lexical structure:

Quote:
quote:URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]
Using this structure, the specification then provides an example of a proper URL that directly contradicts your statement:

Quote:
quote:foo://example.com:8042/over/there?name=ferret#nose
To verify that this specification is what is implemented, I created my own page that included a query parameter and an anchor. Here it is so you can see for yourself: http://www.jonemerson.net/demos/quer...d-anchors.html. For me it works perfectly on both IE6 and Mozilla Firefox.

In conclusion, I don't find any reason to support your argument that putting query parameters and anchors together is invalid. If you can please provide a link to where you learned such a thing, I would be entertained to read it.

Jon Emerson
http://www.jonemerson.net/





Similar Threads
Thread Thread Starter Forum Replies Last Post
Anchor Tag kapilmirchi ASP.NET 1.0 and 1.1 Basics 2 November 18th, 2008 05:57 AM
onClick and go to anchor #something Parabolart Javascript 7 November 28th, 2006 06:45 AM
Javascript in Anchor Tag jamara JSP Basics 1 May 30th, 2005 01:00 AM
Help with paginating and anchor link. major dynamic123 Pro PHP 6 September 11th, 2003 01:47 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.