Jump to content

Saving variables


Antony the Awesome

Recommended Posts

I have been developing an application for use in a game that shows the data in table form of the users of the other alliance. Non important.

I have never ran into this problem before so I am curious how you would approach it.

I have images as links above each column which links to .../index.php?orderby=column_name.

This, obviously, uses the SQL ORDERBY to order whichever column. I also created a "highlight" feature which highlights rows between specified values (ie highlight rows between X strength and Y strength). This uses a form with the GET method.

My problem occurs when you try to use both features. For instance, if you were to sort the strength column, it would simply go to the URL .../index.php?orderby=strength. If you were to then try to use the highlight strength option, it would also use the GET method, simply changing the url to .../index.php?strlow=X&strhigh=Y

This erases the previous orderby variable in the url and would fall to my default orderby I have programmed in.

So, I should be saving ALL of these variables as I set them? Cookies? Sessions? Appending variables to current URL?

I have never encountered this problem before. What should I do?
Link to comment
https://forums.phpfreaks.com/topic/34852-saving-variables/
Share on other sites

I still think that cookies may be my best solution. And I created a routine to grab the url with the GET variables, but that doesn't help with a form unless I would dynamically add hidden values which would be a pretty rigged way of doing things.

Any other opinions?
Link to comment
https://forums.phpfreaks.com/topic/34852-saving-variables/#findComment-164651
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.