website design pattern

The most often occurred use case is:

  1. user opens a webpage;
  2. the webpage reads data from database and displays it to the user;
  3. the user modifies some of the data and clicks the submit button;
  4. the webpage collects the data user inputs and saves it to database;

Note that although the action in the front-end form can point to any url to handle the data user inputs, most time, the same webpage as displays the form is used to handle the data transferred back to the server. So the webpage should differentiate the two situations: should it display the form, or should it handle the data user inputs? This can be done using the following design pattern:

if(!$_POST["submit"])
{
    output the form;
}
else
{
   handle the data user inputs;
}

where “submit” is the name of the submit button on the form.

Did you like this?
Tip admin with Cryptocurrency

Donate Bitcoin to admin

Scan to Donate Bitcoin to admin
Scan the QR code or copy the address below into your wallet to send some bitcoin:

Donate Bitcoin Cash to admin

Scan to Donate Bitcoin Cash to admin
Scan the QR code or copy the address below into your wallet to send bitcoin:

Donate Ethereum to admin

Scan to Donate Ethereum to admin
Scan the QR code or copy the address below into your wallet to send some Ether:

Donate Litecoin to admin

Scan to Donate Litecoin to admin
Scan the QR code or copy the address below into your wallet to send some Litecoin:

Donate Monero to admin

Scan to Donate Monero to admin
Scan the QR code or copy the address below into your wallet to send some Monero:

Donate ZCash to admin

Scan to Donate ZCash to admin
Scan the QR code or copy the address below into your wallet to send some ZCash:
Posted in

Comments are closed, but trackbacks and pingbacks are open.