Forum Moderators: coopster

Message Too Old, No Replies

Usng 'a name' and php

         

Cher

5:22 pm on Apr 27, 2006 (gmt 0)

10+ Year Member



I have a php page that I want to use the href 'name' technique to link to specific sections on the next page. It works fine if I use something like this:

http://somepage.com/page.php#link

I also need pass data to the next php page, as well as get to the specific location on the page.

http://somepage.com/page.php#link?p=data

^ That doesn't seem to work at all. The next page displays starting at the top, instead of directly at the specific location specified in the url.

Is it possible to pass both pieces of information through the same url?

sned

6:29 pm on Apr 27, 2006 (gmt 0)

10+ Year Member



What about switching the the url options around?

http://somepage.com/page.php?p=data#link

-sned

whoisgregg

11:52 pm on Apr 27, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The hash/fragment/anchor bit needs to be at the end:

From [ietf.org...]

<scheme>://<net_loc>/<path>;<params>?<query>#<fragment>

If the parse string contains a crosshatch "#" character, then the substring after the first (left-most) crosshatch "#" and up to the end of the parse string is the <fragment> identifier.

Essentially what you are passing with the reversed order is a request for

https://somepage.com/page.php
and for the browser to jump to the anchor named
link?p=data