Web Scripting Languages: Master Client-Side and Server-Side Development

Web scripting languages make it possible to create dynamic and interactive Web applications by executing code either in the browser or on the server. In this handout, we will examine client-side scripting through JavaScript, learning how it interacts with the DOM, events and browser Web APIs. We will then explore server-side scripting through PHP, which processes HTTP requests, accesses data and generates responses before they reach the browser. We will also study JavaScript and DOM interaction for dynamic interface updates and PHP and MySQL integration, showing how a server-side application can retrieve, process and present data stored in a relational database.

Web Scripting Languages

Key points

  • Web scripting languages → enable dynamic and interactive behavior by executing code in the browser, on the server, or through cooperation between both.
  • Client-side ≠ server-side: client-side code runs on the user’s device, while server-side code processes requests, manages data, and performs trusted operations.
  • JavaScript = programming language used to implement interactive behavior, process information, modify page content, and communicate with servers.
  • ECMAScript ≠ Web APIs: ECMAScript defines the JavaScript language, while Web APIs provide browser capabilities such as DOM manipulation, events, networking, and storage.
  • <script> → connects JavaScript to an HTML document; the defer attribute postpones execution until HTML parsing is complete without blocking parsing during download.
  • DOM manipulation → JavaScript locates elements, reads or changes their content and attributes, and updates the interface without modifying the original HTML file.
  • Event = signal indicating an occurrence; event listeners associate functions with events such as click, input, change, and submit.
  • Event-driven interaction → user action → browser event → callback execution → data processing → DOM modification → interface update.
  • Client-side validation → provides immediate feedback but ≠ authoritative verification; sensitive operations and security-critical checks must be performed on the server.
  • PHP (Hypertext Preprocessor) = server-side scripting language used to process HTTP requests, execute application logic, and generate responses such as HTML or JSON.
  • PHP execution → browser request → web server → PHP application → optional database operations → HTTP response; the browser receives results, not PHP source code.
  • Routing = mechanism associating URL paths with application functions; a requested path does not necessarily correspond to a physical PHP file.
  • PHP request data → $_GET accesses query parameters, $_POST accesses ordinary POST form data, and $_COOKIE accesses cookies sent by the browser.
  • Cookies ≠ sessions: cookies store information in the browser, while PHP sessions normally retain user-associated data on the server using a cookie-based session identifier.
  • SQL (Structured Query Language) ≠ MySQL: SQL defines operations on relational databases, while MySQL is a database management system that executes SQL statements.
  • SQL operations → SELECT retrieves data, INSERT adds rows, UPDATE modifies records, DELETE removes rows, and CREATE TABLE defines tables.
  • PDO (PHP Data Objects) → connects PHP to database systems such as MySQL, executes SQL statements, and retrieves results for server-generated content.
  • Prepared statements → separate SQL instructions from parameter values, allowing user-supplied data to be passed without directly inserting it into SQL code.
  • Input handling → user-provided data must be processed according to its destination; htmlspecialchars() prepares text for appropriate HTML contexts but does not protect SQL operations.
  • Dynamic page generation → HTTP request → PHP processing → SQL query through PDO → database results → HTML generation → HTTP response → browser rendering.

Do you want to help me write articles like this one?

Leave a Reply

Your email address will not be published. Required fields are marked *

No responses yet

Sostieni il progetto

Tutti i materiali che condivido nascono da una convinzione molto semplice: una buona formazione non dovrebbe limitarsi a insegnare quali pulsanti premere, ma aiutare a comprendere le idee, i principi e i processi che stanno dietro agli strumenti.

Per questo dedico una parte significativa del mio tempo a studiare, organizzare e produrre contenuti gratuiti dedicati al multimedia, al design e alla comunicazione visiva. Articoli, lezioni, approfondimenti e risorse che hanno l’obiettivo di rendere accessibili argomenti spesso affrontati in modo frammentario o superficiale.

Questo lavoro richiede però tempo, ricerca e cura. Ogni guida, ogni video, ogni materiale pubblicato gratuitamente è il risultato di molte ore di studio, scrittura e revisione.
Sostenere il progetto attraverso Patreon significa permettermi di continuare a produrre contenuti educativi di qualità, mantenerli accessibili al maggior numero possibile di persone e dedicare più energie alla costruzione di una risorsa che possa essere utile a studenti, professionisti e appassionati.

Se credi che una conoscenza più profonda, rigorosa e consapevole del multimedia abbia valore, il tuo contributo non sostiene soltanto il mio lavoro: aiuta a rendere queste risorse disponibili per tutta la comunità.
Grazie per il supporto e per la fiducia.

Patreon è troppo impegnativo?

Puoi sostenermi anche con una donazione libera, senza abbonamento e senza impegno.
Anche un piccolo contributo mi aiuta a continuare a creare giochi, contenuti didattici e materiali gratuiti con più libertà.

Support the project

All the materials I share stem from a very simple conviction: good training should not be limited to teaching which buttons to press, but should help people understand the ideas, principles, and processes behind the tools.

That is why I dedicate a significant portion of my time to researching, organizing, and producing free content focused on multimedia, design, and visual communication—articles, lessons, in-depth analyses, and resources aimed at making accessible topics that are often addressed in a fragmented or superficial way.

However, this work requires time, research, and care. Every guide, video, and piece of material published for free is the result of many hours of study, writing, and revision.
Supporting the project via Patreon enables me to continue producing high-quality educational content, keep it accessible to as many people as possible, and devote more energy to building a resource that benefits students, professionals, and enthusiasts alike.

If you believe that a deeper, more rigorous, and informed understanding of multimedia is valuable, your contribution does more than just support my work: it helps make these resources available to the entire community.
Thank you for your support and trust.

Is Patreon too demanding?

You can also support me with a voluntary donation—no subscription or commitment required.

Even a small contribution helps me continue creating games, educational content, and free materials with greater freedom.