Script Languages

Two of the most popular server-side scripts (i.e.: they are executed on the server of the host computer, not the PC of the person browsing) are PHP and ASP.

PHP

PHP was developed by Rasmus Lerdorf in 1994 as Personal Home Page. It is a parser (a program that reads a code and constructs an output based on a set of rules) that interprets files written in the simplified programming language of PHP. PHP has a lot of similarities in it's structure and syntax to other script languages, e.g. JavaScript.

Just three years later about fifty thousand websites were utilising PHP and a team of programmers revised PHP to provide support for the database query language "MySQL".

The current version of PHP (now meaning PHP: Hypertext Preprocessor) version 5, includes more features and greater system efficiency.

PHP can be mixed with HTML code in a .php file or set up as a separate file, for example to handle the input of an HTML form. When the PHP page is parsed by the processor only the resulting HTML code is sent to the browser, the original PHP code is always removed.

PHP Example: Show the Current Date.

The simple piece of PHP below is written into this web page, so you should see the current date displayed below.

<?php

This tells the PHP processor this is the start of a segment of PHP script.

$curr_date=getdate(date("U"));

This defines the value of a variable.

print("<p>The current date is: $curr_date[weekday], $curr_date[month] $curr_date[mday], $curr_date[year]</p>");

This is the main part of the script, giving the PHP processor instructions on what to do.

?>

Finally this tells the PHP processor this is the end of a segment of PHP script.

The result of the code above is:

The current date is: Friday November 24, 2017

ASP (Active Server Pages)

ASP is Microsoft's technology to build dynamic web sites. It is being superseded by Microsoft's ASP.NET web application framework.

ASP and ASP.NET are both capable of producing dynamic and database driven web sites, but the code is entirely different. You also need to competent with the programming languages C#, Visual Basic or JScript.