PHP
What is it?
PHP (Hypertext Preprocessor) is a widely-used server-side scripting language designed specifically for web development. It can be embedded directly into HTML and executes on the server before the page is sent to the browser, making it invisible to users. PHP powers major platforms like WordPress, Facebook, and Wikipedia, and integrates seamlessly with databases like MySQL.
Practical example
A PHP contact form processes user submissions on the server. When a user submits the form, PHP receives the data via the $_POST superglobal, validates the input to ensure required fields are filled, sanitizes it to prevent security issues like XSS, then either saves it to a MySQL database or sends it via email using the mail function or a library like PHPMailer.
Test your knowledge
Where does PHP code execute?