Jump to content


Photo

Saving state(very limited)


  • Please log in to reply
6 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 08 September 2006 - 12:52 PM

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.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 08 September 2006 - 01:45 PM

so why can't you use GET?
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#3 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 08 September 2006 - 01:49 PM

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?

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#4 syed

syed
  • Members
  • PipPipPip
  • Advanced Member
  • 151 posts
  • LocationEngland

Posted 08 September 2006 - 01:53 PM

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.

#5 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 08 September 2006 - 01:55 PM

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.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#6 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 08 September 2006 - 01:58 PM

yes, I was thinking sessions, I just needed some help with the brainstorming, thanks for the input

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#7 syed

syed
  • Members
  • PipPipPip
  • Advanced Member
  • 151 posts
  • LocationEngland

Posted 08 September 2006 - 02:00 PM

No probs business man, best of luck with your project.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users