Made with ScholarlyTurn your own files into documents like this
Shared by Lovely Joy Rico
Web applications and PHP development center on separating a browser-facing front end from a server-side back end. The browser requests resources, the server runs application logic and may query a database, and the resulting response returns to the browser. The main exam focus is tracing how front-end input moves through PHP, sessions, SQL, Apache, and MariaDB to produce a response (p. 1).
A web application is accessed through a web browser and relies on a remote web server for processing. Unlike traditional desktop software, it generally does not require a full local installation; the same application can be reached across platforms wherever network connectivity is available. Centralized deployment makes updates and maintenance easier (p. 1).
Remember the division as HTML = structure, CSS = appearance, and JavaScript = behavior (p. 2). HTML supplies structure and content, CSS controls presentation and styling, and JavaScript supplies behavior and interactive page changes. Together, they can control dynamic behavior without a server round trip for every interaction (p. 1).
The back end handles requests, processes inputs, executes application logic, and communicates with data stores. PHP is described as a popular, free, open-source server-side scripting language. It runs across major platforms, works with many web servers and databases, can be embedded in files containing HTML, CSS, and JavaScript, and produces dynamic page content when executed by the server (p. 2).
A PHP file is processed on the server. The browser receives the generated response, not the PHP source code; therefore, PHP belongs to the back end even when it is embedded in an HTML page (p. 2).
PHP supports data handling through variables, constants, and arrays; control structures such as conditionals and loops; and object-oriented programming. In OOP, classes define reusable structures and objects are instances. Encapsulation bundles data with related behavior, making code more modular, reusable, and manageable. Constructors and destructors help control an object's lifecycle (p. 2).
HTML forms provide a primary interface for collecting user input. Read the three key attributes as a route:
A form controls how data travels; it does not make user input safe. Submitted values must be treated as untrusted and validated in the server-side application before they are used (p. 3).
HTTP requests are separate, so an application needs a way to retain user-specific context across multiple pages. A PHP session stores state associated with a browsing session, enabling the application to remember a signed-in user or a shopping cart as the user moves through the site. A session is the bridge between otherwise independent page loads (p. 3).
The source's session sequence is: start or resume the session before accessing session values; store only the user context the application needs; read values on later pages to personalize or authorize behavior; and end or invalidate the session when its lifecycle should close, especially at logout (p. 3).
A web application becomes data-driven when PHP communicates with a database. SQL queries retrieve stored data and modify it through operations such as inserting, updating, or deleting records. PHP functions connect application logic to these queries, allowing a request to produce content from current data (p. 3).
XAMPP is an easy-to-install development stack that bundles Apache as the web server, PHP as the server-side runtime, and MariaDB as the database. It provides a local environment for building and testing dynamic applications. Keep the roles separate: Apache serves and routes requests, PHP executes application code, and MariaDB stores relational data; XAMPP packages these components but does not replace understanding their individual jobs (p. 4).
A login screen illustrates the front-end division: HTML places the labels and fields, CSS arranges and styles them, and JavaScript checks whether required fields are filled before submission. However, the server is still needed to authenticate the account; the browser-side check improves immediate interaction but does not perform the server-side authentication (p. 2).
A request for profile.php can cause PHP to read a session value, query a database for the matching profile, and insert the result into an HTML response. The browser displays the completed page, while data retrieval and decision-making remain server-side (p. 2).
A product page receives an item identifier. PHP uses that identifier to request the matching record with SQL, and the server renders the product name and price into HTML. A later request can show a different record without requiring a separate static page for every product (p. 4).
For a form or URL request, input reaches PHP; PHP validates and processes it; SQL reads or changes database records; and PHP combines the result with a response. The database supplies persistence, while PHP supplies application logic (p. 4). This is the sequence to use when tracing a form that updates a database and then displays a confirmation page.
Be able to:
action, method, and target attributes by answering Where?, How?, and Where does it appear? (p. 3).Make from this