Antony the Awesome Posted January 19, 2007 Share Posted January 19, 2007 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=YThis 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 More sharing options...
trq Posted January 19, 2007 Share Posted January 19, 2007 Append to the url, don't replace it. Link to comment https://forums.phpfreaks.com/topic/34852-saving-variables/#findComment-164315 Share on other sites More sharing options...
Antony the Awesome Posted January 19, 2007 Author Share Posted January 19, 2007 What confuses me is how would you append another variable to the url? I have ideas, but they seem unconventional. Link to comment https://forums.phpfreaks.com/topic/34852-saving-variables/#findComment-164316 Share on other sites More sharing options...
Nameless12 Posted January 19, 2007 Share Posted January 19, 2007 I have come across this before and appending the text works in simple cases but is just not up to scratch I will leave the reasons why to your imagination. The best solution is to create an object that allows you to add\delete\update values from a string. Link to comment https://forums.phpfreaks.com/topic/34852-saving-variables/#findComment-164481 Share on other sites More sharing options...
Antony the Awesome Posted January 19, 2007 Author Share Posted January 19, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.