Jump to content

The query string


dps123
 Share

Recommended Posts

I have a custom pager on my page which has a select menu for selecting which page you want to go to. Each option in the select menu looks something like this:

<option value="<?= $page->url.'page5'; ?><?= $_SERVER['QUERY_STRING']; ?>">5</option>

So what I'm expecting is a URL like:

/members/notes/page5/?horse=Horse+Name&category=5&from_date=01.04.2016&to_date=15.04.2016

But $_SERVER['QUERY_STRING'] is giving me this, which obviously isn't working when I append it $page->url.

it=members/notes/&horse=Horse+Name&category=5&from_date=01.04.2016&to_date=15.04.2016

Has anyone else had this issue or know how I can get around it?

Link to comment
Share on other sites

Take a look into MarkupPagerNav, which does exactly this for creating it's paginations.

The issue you're facing is actually not an issue, but a common practice for frameworks of all sorts. The .htaccess file does rewrite the request to be able to enter the application always via the index.php. To still know where the user wanted to go the path must be passed as get variable. In case of ProcessWire this get variable is "it".

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...