PHP ExamplesLesson 83Free preview
PHP Server
This lesson is part of PHP · All levels
Summary
PHP runs on the server side: the script is executed on the computer where PHP is installed, and the result is sent to the browser as HTML. During that process PHP provides superglobal variables such as $_SERVER, $_GET, and $_POST that contain information about the request and server environment. Understanding this model lets you know which parts are safely hidden from the user.
Key points
- PHP is executed on the server so the original source code never gets to the browser.
- $_SERVER['REQUEST_METHOD'] indicates GET or POST, $_SERVER['QUERY_STRING'] contains the URL query.
- Forms are sent using the GET (data in URL) or POST (data in request body) methods.
- The input data from the request must be validated before use or storage.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.