Browsers & HTML
Typically web pages are written in Hypertext Markup Language (HTML) which is a standardised coding system for tagging text files to instruct browsers how to display their content in terms of font, colour, and layout. HTML often uses Cascading Style Sheets (CSS) which is a coding language that helps organise the style tags in a reusable format (i.e. a set of style tags is defined in one place but can be applied to content elements across the site).
Browsers can be used to display an HTML file that is stored on your computer but usually your browser is sending requests over a network (the Internet or a local Intranet) to retrieve web pages or documents from a remote server, the host web-server.
Web Links & URLs
A web link is some text or a graphic displayed in a document or web page that you can click on to open another document or web page. The link contains a URL (Universal Resource Locator) that is not displayed in the document or web page. On some applications or browsers, the link URL is displayed while you have your mouse pointer over the link. A URL for the home page of a website might look like this:
This comprises the protocol (http) and the host name (www.my-site.com). The URL for a page other than the home page will include the page name like this:
If the website is organised in a folder structure on the host server, then the URL needs to identify the folder that the page is in and so could look like this:
Some web pages, like search pages, allow you to enter text that is processed and the result returned. In this case the URL needs to include the search text:
When you click on any such link, your browser sends a request to the host which responds with the requested resource for your browser to display.
Back to the Browser
A good example of dynamic content is the results page you get when you do an Internet search. Dynamic content requires processing that includes reading and writing to files or databases on the server. Similarly, Content Management Systems like WordPress store page content (text, images, etc.) in a database. The webpage is a template that needs to retrieve content for display. Giving the browser direct access to the server database or write access to server files would create a number of problems.
Browsers are excellent at displaying pages and that is really all they should be asked to do. Processing for dynamic content and providing access to server resources beyond reading HTML pages is better handled on the server and PHP provides this capability.
PHP & Databases
Hypertext Preprocessor (PHP) is a scripting language designed for web development. When the web server gets the request for a document, it determines if the requested document is to be returned to the browser or if something else needs to happen first. If the document is a PHP file, the server submits it to the PHP interpreter. The PHP interpreter goes through the file, executing any PHP scripts it finds, and returns the output, which should be well formed HTML, to the web server which sends it back to the browser to display.