AJAX requests and PHP responses

Thomas Mak wrote at 2017-04-20.

#php #php-basic

AJAX requests and PHP responses
  1. JavaScript sends requests to PHP through internet.
  2. PHP handle the requests with parameters from $_GET or $_POST.
  3. PHP has the $data, either from database or other data sources.
  4. PHP includes essential external PHP files and functions to complete the logic.
  5. PHP sends processed data in JSON response via echo and json_encode.
  6. Response is sent back to JavaScript through internet.
  7. JavaScript handles the data from PHP.
  8. JavaScript changes HTML DOM structure and content via clone, append, text etc to display the data.

Comments

no comments yet.