Fork me on GitHub

Posts Tagged ‘beginner’

Basic PHP Tutorial

05 Nov

Ok, so how do you load a .php file into your web browser, and what does it do when you type (for example) then hit enter?

  1. The web browser requests the document with the .php extension from the server.
  2. The webserver kicks in and says “Hey! Someone wants a PHP file. Something else needs to deal with it because I only serve HTML”, and then sends the request onto a PHP parser software located on the server.
  3. The PHP parser finds the PHP file, then scans it for PHP code from top to bottom, left to right (how we read … that is if you’re English).
  4. When the PHP parser finds PHP code, it executes it and places the output (if any) into the place in the file formerly occupied by the code.
  5. This new output is sent back to the webserver.
  6. The webserver then sends it along to the web browser.
  7. The web browser displays the output.

Read the rest of this entry »


Posted in PHP