How can I make a dynamic web page in PHP?

Process that occurs when a Web browser requests a PHP-enhanced web page...?

  • Explain the process that occurs when a Web browser requests a PHP-enhanced web page, containing information from a database, through to the browser receiving the finished page.

  • Answer:

    Consider this address (move your mouse over the link because Yahoo cuts it off): http://www.example.com/directory/page.php?param=value#bookmark This is typically what happens: 1. The browser requests the IP address of www.example.com from the operating system. 2. The operating system in turn requests this IP address from DNS. 3. When the browser gets the IP address, it contacts the web server at the IP address through HTTP (TCP port 80), tells it which hostname (www.example.com) and path (/directory/page.php) it wants, and sends the cookie if it has one. 4. The web server looks up the handler of .php files (in this case the PHP executable) 5. The web server initiates a new instance of the PHP executable and passes it all context (HTTP headers, server variables, path, parameters) through a SAPI. 6. The PHP executable opens the requested script file (page.php) and interprets it. 7. The script connects to a database server and fetches the data. 8. The script renders a HTML page and passes the output to the web server. 9. The web server sends the output, along with response headers (containing the optional cookie) to the browser. 10. The browser renders the HTML and scrolls to the bookmark. There's much more to it, like HTTP headers, virtual hosts and error handling, but this is in a nutshell what happens. The same process happens for resources on the page, like images, javascript files and css files, but the browser already knows the IP address so it skips step 1 & 2, and there is no handler for those files, so it just looks up the mime type and sends it to the browser along with the contents of the file (steps 5-8 are skipped).

Bella at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

You may be able to extract the information that you require from the link below, look at the options on the left and pick one that fits; http://www.php.net/manual/en/index.php Or; http://www.php.net/manual/en/intro-whatcando.php There must be an explanation for you in there somewhere, do no forget the sub menus in blue by the way. I am rather glad that I do not have to learn about such things anymore. Regards, Bob.

Southpaw

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.