Title: About State and Stateless web pages
Course: PHP/MySQL Course

About State and Stateless web pages

Basic web pages are called stateless, they have no memory that you have been to them before, even if you have just hit refresh on your browser, the web server and php do not know you were there.

State refers in programming to remembering some information between different times your program is run.

Since it is very useful to have your web pages and your web site remember some information between visits to pages on your site, there are several ways of accomplishing this.

1. A hidden form field:
This is one way of remembering data, and this was used on the chuck-a-luck and was covered on pages 208 and 209.

2. Using Cookies

3. Using a put key value pair

4. Staying on the same page and interacting with the web server dynamically (this is AJAX technology). We will not be covering this in our class

All of these methods use a simple mechanism to pass along 'who' is visiting and then must usually look up the data that needs to be remembered using either sessions, files, or a database. The 'who' is used to look up the correct information.

If you would like to find out more you can read this article at IBM.com:
The Stateless State