Server-Side Scripting – PHP

Server-Side Scripting – PHP

Server-Side Scripting - PHPHypertext Preprocessor (PHP), a server-side scripting language which can stand alone or be combined with HTML, is used to make dynamic and interactive Web applications. This is done by processing hypertext documents before it is served to a browser to be viewed. The best way I know to describe how PHP actually works is to give a step by step example.

  1. A user requests a document from the web.
  2. If the document is an HTML one, the server sends it to the browser; end of story.
  3. If the document is PHP, the server will send it to the PHP interpreter where it is searched for any PHP commands.
  4. The interpreter finds the commands, removes them, and then replaces them with output that the PHP commands generate.
  5. The document is then sent, with the PHP removed, back to the user’s browser (Stobart, & Parsons, 2008, p. 246).

Hypertext Preprocessor (PHP)

PHP code, just like HTML and XML, is identified through special tags. For the most part, PHP is written just like HTML in that it can be created and edited the same way one would HTML files. The main goal of PHP is to allow web developers to write dynamically generated web pages quickly. However, it can also be used for collecting form data, generating web content, sending and receiving cookies, and much more. I use it when building contact pages for clients. The three main areas where PHP scripts are used are: server-side scripting, command line scripting and for writing desktop applications (The PHP Group, 2013).

Active Server Pages (ASP)

Active Server Pages (ASP) is another server-side scripting technology that can be used to create dynamic and interactive Web applications. ASP however, is a feature of the Microsoft Internet Information Server and is processed on a Microsoft Web server before the page is sent to the user (Rouse, 2005). That is actually one of ASP’s biggest drawbacks over PHP. ASP is also said to have less stability and is a more cumbersome language than PHP.

PHP is an open source language and can connect to databases that are used with MySQL, which is free. With ASP one has to purchase MS-SQL which is a Microsoft product. But which one is better? I guess that really depends on one’s knowledge. Based on what I know PHP is much easier to learn and use. However, if I had been taught with Visual software I would probably find it easier to use ASP.

References

Rouse, M. (July, 2005). Active Server Page (ASP).Tech Target. Retrieved from http://searchwindowsserver.techtarget.com/definition/Active-Server-Page

Stobart, S. & Parsons, D. (2008). Dynamic Web Application Development Using PHP and MySQL. Cengage  Learning, Inc.

The PHP Group, (2013). What can PHP do? Retrieved from http://php.net/manual/en/intro-whatcando.php

Posted in Web Applications, Web Development.

Leave a Reply

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