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?
Printable View
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?
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..
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 &.
Thanks for the tip. I got it working just before reading this actually..heh.
Although I used the delimiter : rather than &