Ninjakreborn Posted September 8, 2006 Share Posted September 8, 2006 I could pass this through get, but I need something more sub-stantial, I think get would cause me problems. Ok I have a site I am building, I have a problem(I am still in planning phase), so I am working out all my programming plans, and design plans ahead of time, adn trying a totally different approach. WHen I seem to go over all the programming logic ahead of time, I uncover problems I would have ran into during the process. I figure out what's worth doing, and what needs to be scraped, and that is going to help me during the development process. There is one issue I ran across, on the homepage(it's a classified ads site), I have a list of things on the homepage, but there is a case/switch statment, with includes, that decides what is included for the main area. See it's based on schools, so I need to be able to make it, based on which one was selected, that include is shown, but stays shown until they switch schools, and it has to be something that all user's can use. Should I save it in with whatever sessions they are using, and let it carry around with there specific session, but on the homepage, I am starting the include out as a specific one, so when they change it, I am trying to figure out a good way to save the school, I need to start the school at a specific one of course, but I wanted to get an idea, of that. I am thinking of carrying it around based on the user, within a session(using the same session they are logged in with, does this sound like a good idea. Quote Link to comment https://forums.phpfreaks.com/topic/20112-saving-statevery-limited/ Share on other sites More sharing options...
.josh Posted September 8, 2006 Share Posted September 8, 2006 so why can't you use GET? Quote Link to comment https://forums.phpfreaks.com/topic/20112-saving-statevery-limited/#findComment-88371 Share on other sites More sharing options...
Ninjakreborn Posted September 8, 2006 Author Share Posted September 8, 2006 In this situation, it has to be final than that. For instance, it starts off with one chosen by default, then select a different one from a drop down menu, which is going to change it, but it stay's changed at this point. I may have them as links, but I want to keep the programming clean on this one, ahving a bunch of get's feeding back onto the same page, will get a little aggravating, I am in the planning phase, and have 2 weeks from monday, so I am coming up with ideas ahead of time, do you think using hte sessions will work as well, so it can register the session, and put the proper includes based on the session that is registered? Quote Link to comment https://forums.phpfreaks.com/topic/20112-saving-statevery-limited/#findComment-88372 Share on other sites More sharing options...
syed Posted September 8, 2006 Share Posted September 8, 2006 Hi there business man, I have read your post several times, to try and figure out what it is that you want. What are you trying to save? What is selected? If you are trying to display items that a user has selected and display them across your site, then yes you could use a session, but remember a session will be lost when it expires. So when the user is logged out or the session expires the data will be lost. Alternativly you could use cookies to track user selection or what ever, and have the cookie expire after a week or a month or when ever. This way as long as a cookie is available your users can come back and there previous selections would still be available. Disadvantage is that if a user has a high selected security on their browser, then cookies might not be saved depending on the security level. Also when the user clears out their cookies the the data will be lost.If you just want to display selected items by the user for the duration of the time they are logged in then just use sessions. Unless some one has a better idea. Quote Link to comment https://forums.phpfreaks.com/topic/20112-saving-statevery-limited/#findComment-88377 Share on other sites More sharing options...
.josh Posted September 8, 2006 Share Posted September 8, 2006 i would go for session variables. and if you want the user's selection to be more permanent than for the duration of the session, store the value in your db for later retrieval. Quote Link to comment https://forums.phpfreaks.com/topic/20112-saving-statevery-limited/#findComment-88380 Share on other sites More sharing options...
Ninjakreborn Posted September 8, 2006 Author Share Posted September 8, 2006 yes, I was thinking sessions, I just needed some help with the brainstorming, thanks for the input Quote Link to comment https://forums.phpfreaks.com/topic/20112-saving-statevery-limited/#findComment-88381 Share on other sites More sharing options...
syed Posted September 8, 2006 Share Posted September 8, 2006 No probs business man, best of luck with your project. Quote Link to comment https://forums.phpfreaks.com/topic/20112-saving-statevery-limited/#findComment-88384 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.