Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5944661
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:34:14+00:00 2026-05-22T16:34:14+00:00

This questions is about lists of data in a back-office, with variables like order,

  • 0

This questions is about lists of data in a back-office, with variables like order, # of page, filter, etc..

I used to pass this variables between pages by GET, but I had many troubles and changed to storing this variables in session. I don’t mind bookmarking problem, since it’s a back-office tool. All was ok until today: I was viewing a list, I changed one filter, and then I wanted to go back to previous results. My natural gesture was pressing browser “back” button. Of course, I wasn’t taken to previous results, because I had overwritten the session.

So, which is the best method to do this? Having in mind not only user’s experience, but coding facilities and avoiding mistakes.

Troubles I’ve found when I passed variables by URL, specially in two or three levels lists:

  • There are many variables and many
    places where I have to put them: link
    to editting an item, form’s action,
    back links, page navigation links…
  • Some variables can have the same
    name (i.e., each level will have a
    number of page). It’s easy to make a
    mistake with this, specially when you
    have to code new things inside a
    previous script.
  • I can’t just use
    the query string, because there are
    cases in which I have to change some
    var’s value (i.e., in paging
    navigation links I’ve to change
    number_of_pag variable).

I suppose the best solution is not “Hey, if you pay more attention, you won’t make these mistakes”. Is there any system I haven’t discovered yet? How the great ones do this?

Maybe implementing methods to render links automatically?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T16:34:15+00:00Added an answer on May 22, 2026 at 4:34 pm

    The place for these types of variables are the query string. Not only is it needed for bookmarking, but it is needed for navigating to the given content in general, as you discovered with the back button. However, if you really want to abbreviate the query string, consider using a token or identifier instead.

    That is, in session, consider using a system like this:

    // this represents the query data for one page request
    $_SESSION['queryid']['38hghfd85423lk'] = array(
        'all' => array('the => 'query', 'data'),
        'is' => array('stored', 'like', 'this)
    );
    
    // this represents the query data for another page request
    $_SESSION['queryid']['432423jkgrfsd9'] = array(
        // .... other data ....
    );
    

    Now your query string will look like so:

    http://www.example.com/index.php?queryid=38hghfd85423lk
    

    Or like this:

    http://www.example.com/index.php?queryid=432423jkgrfsd9
    

    Of course, you use the queryid given in in the GET data to identify which query data to use from $_SESSION. Now the browser back button will work.

    A problem may be that, after long sessions, the cache of queries in $_SESSION will become quite large. To mitigate this you can limit the length of the cache, say to the last 100 pages. If a user tries to navigate more than 100 pages back, you will notice their queryid no longer exists and will be able to notify them that the page expired.

    If you wanted to support bookmarking, you can save the queryids and data to a database. Of course, you may still have to consider pruning methods — say, queryids that haven’t been used in a month are cleared. This may be frustrating to a user, however.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Most of the questions about merging data.frame in lists on SO don't quite relate
i find a lot of questions about this problem but i did not solve...
There are several other questions about this topic that I have gone through, but
I've asked a few questions about this, but haven't found the answer (or maybe
Hi i have a questions about this http://dl.dropbox.com/u/143355/datepicker/datepicker.html twitter bootstrap plugin. How to change
I have a few questions about this after reading the iPhone documentation on it:
I noticed some similar questions about this problem when I typed the title, but
I found some other questions about this, but they didn't work for me :(
I've seen some similar questions about this around here but I didn't see anything
Okay I know there are a lot of questions about this and a lot

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.