Credit: Pumpkin icon by Good Ware, https://www.flaticon.com/authors/good-ware, from www.flaticon.com, used with permission.
Processing Forms on a Server Vs. by the Client
The data must be processed somehow
That means software to do it must be somewhere
On a server:
Can run complex software
Like databases
Can be important!
Server must be running properly
Server must permit software to run
Not the case for e.g. wordpress
Nor other typical content management systems
IFSC 4365 Web Server Applications explains more
Key concept: persistence
Servers can persist data
To persist data:
To save data across sessions
On a client
Client:
Usually that means browser
A server-using local app
Server details don’t matter
Server can permit extra software or not
Coder needs no server access
Can even run without a server
Browsers work on local files too
Browsers can process form data too
Typically using JavaScript
Problem: databases
Web pages don’t contain DBs
General problem: persistence
Browsers can’t remember things
But… browsers can persist some data!
Not databases though
That’s an important limitation
Cookies exist to enable browsers to persist data
We cover cookies in a future session
There is limited local storage
window.localStorage.setItem("lastname", "Smith");
window.localStorage.getItem("lastname");
For short:
localStorage.setItem("lastname", "Smith");
localStorage.getItem("lastname");
That’s DB-like, actually
It is user, browser, computer, and protocol-specific
Won’t work across computers, etc.