Ok, so how do you load a .php file into your web browser, and what does it do when you type (for example) http://www.edrackham.com/index.php then hit enter?
- The web browser requests the document with the .php extension from the edrackham.com server.
- 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.
- 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).
- 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.
- This new output is sent back to the webserver.
- The webserver then sends it along to the web browser.
- The web browser displays the output.