Page 512 - Computer_Science_F5
P. 512

Implementation of server-side                 data, or any other logic necessary
              Scripting                                     to generate the response.
               (a) User request: A user requests a       (d) HTML generation: The  script
                   page from their web browser by           produces HTML (and possibly CSS
                   clicking a link, submitting a form,      and JavaScript) as output.
          FOR ONLINE READING ONLY
                   or entering a URL.                                                              Chapter Eight: Databases and Database Management Systems
               (b) Server process: The web server        (e) Response sent: The web server
                   receives the request and finds the       sends this generated HTML back
                   appropriate server-side script to        to the browser as the response to
                   handle it.                               the original request.
               (c) Script execution: The script runs on   (f)  Browser rendering: The user’s
                   the server, performing actions such      browser  renders  the  HTML,
                   as querying a database, processing       presenting the web page to the user.



                                    2. Web server locates the page file
                                    3. Web server asks the script engine to process
                                        script and generate HTML



                                                   4. HTML stream passed back to the server

                     Web Server
                                                                        5. Browser processes the
                                                                            client side scripting


                                                                        6. Browser processes
                 1. A client requests HTML                                  HTML and displays
                     page by typing                                         the web page
                     address or URL

                                                              Client
                                                         (User's Computer)


                                        Figure 8.25: Server-side scripting
              PHP’s role in web development stack
              PHP is one of the most popular server-side scripting languages designed specifically
              for  web  development. It  fits  into  the  server  side  of  the  web  development stack,
              interacting  with databases, managing session  data, and performing condition-
              based operations to generate dynamic web content. PHP scripts can be embedded
              directly within HTML documents, allowing for a seamless combination of static and
              dynamic content.


                                                    503
               Student’s Book  Form Five



     Computer Science Form 5.indd   503                                                     23/07/2024   12:35
   507   508   509   510   511   512   513   514   515   516   517