|
-
Jul 18th, 2006, 02:13 PM
#1
[RESOLVED] $_GET['year] -- ?sort=alpha?year=2006
I am trying to use 2 GET variables in some code I am doing.
First get is $_GET['sort'];
Second is $_GET['year'];
But sort pulls out "alpha?year=2006"
Anyone know how to get around this?
-
Jul 18th, 2006, 02:22 PM
#2
Re: $_GET['year] -- ?sort=alpha?year=2006
Updated a little: I am trying ot access it with this link
?page=alphabetical#?year=2006
$_GET['year'] doesnt grab anything. If i hard code the 2006 the query works. So all I have to do is figure out how to get it to grab year now..
-
Jul 18th, 2006, 02:35 PM
#3
Re: $_GET['year] -- ?sort=alpha?year=2006
The URL is invalid.
A http URL may only contain a single ?. It marks the start of the query string. The query string can be anything, but typically it is a series of name=value pairs separated by &.
The # character marks the start of the fragment identifier. It is not part of the server-side resource locator (i.e. the server is not allowed to send different things depending on it) and will, in fact, not be sent by most browers but instead interpreted locally.
The URL you want is
"http://www.example.com/path/to/page.php?sort=alphabetical&year=2006"
Of course, if you put that into a hyperlink's href attribute (or anywhere else in the HTML with the exception of script elements), you must escape each & to &.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Jul 18th, 2006, 03:06 PM
#4
Re: $_GET['year] -- ?sort=alpha?year=2006
Thanks for the tip. I got it working just before reading this actually..heh.
Although I used the delimiter : rather than &
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|