I figured rather than starting two new threads for this, just combine them both into this one.
For a while now I've been reading on the differences between both Cookies and Sessions as well as Classes and Functions. Just so I don't confuse anybody (or myself for that matter), I'll break it down.
Cookies vs Sessions:
I understand you can use these for different things. If I'm correct, then somewhere I read that a session contains some sort of cookie. Let's say I was creating a script (be it a bulletin board, a shopping cart, etc), which one would I want to use and why? I have three (3) PHP/MySQL books and I've read all three of them for sessions and cookies and I'm still not sure why I should use one over the other. I have also done a search here at PHPBuilder, as well as some other sites to get more information, but I'm still not sure which one I should use or why. I would appreciate some clarification on this.
Classes vs Functions:
Well I realize, to an extent anyway, you can't compare the two. I understand a class holds information, and a function holds commands to do something (objects?). I'm trying to understand OOP and my problem is that I make it more complicated than what it really is. Again, I read my books on classes and functions, and I did a search here at PHPBuilder and other sites to gather more information. Some have said they prefer to use strictly classes while others strictly use functions. I would appreciate a clarification on these as well.
Different books explain concepts differently, which is why I'm asking here, hoping that someone will have a different way of explaining it, perhaps in a way that is easier for me to understand. I'm fairly new to PHP, I haven't created anything to fancy, but I would eventually like to. I've done a ton of reading in books, web sites, and here at PHPBuilder. I'll go through and look at the problems everyone else has, and read what other people say to try and help them, and I try to learn that way. It does work, however, there are just some things that keep boggling me, and these two concepts are some of them. Perhaps somebody here can provide some sort of clear explanation to each of these and then perhaps I'll understand them better.
Thanks for taking the time to read this, and I appreciate any feedback I get. 🙂