Client Side Programming
In web applications, client-side programming is usually written in HTML meanwhile the application servers, the middle tier in three-tier client/server architecture, are usually written in C++ or Java. By using a scripting language embedded in HTML, web servers act as translation layers that allow for communication between the client and server layers. Application servers perform the in-house work of analyzing site traffic and creating personalized pages based on dynamic data such as user history and behavior on previous visits to web sites.
Scripting languages are high-level interpreted programming languages. That is to say, at runtime (whereby processing occurs while the program is being executed), scripting languages are interpreted by another program rather than compiled. Compiling turns source code into objects.
Compiling takes several steps to make a program executable and the runtime interpretation that takes place through scripting languages is much quicker. Server-side scripting is a technology that works to help web servers generate dynamic HTML web pages. Scripts are run directly on the web server. Their primary benefit is their ability to return highly customized responses, as discussed previously. They provide highly interactive web sites with user-friendly interfaces connected to databases.
They control user access, respond intelligently to user requirements, and base responses on queries in their databases. Scripting languages can be embedded in HTML and are commonly used to enhance web page functionality with different features such as different menu styles or graphic displays. But, basically, server-side scripting languages help translate and manipulate data from a database on the server. Remember, servers help manage network systems, process requests, and deliver responses.
This article will discuss some of the major server-side scripting languages as an introduction to their role on web servers.
Perl stands for Practical Extraction and Reporting Language. It was designed by Larry Wall with the specific purpose of processing text. Perl, first released in 1987, is one of the original scripting languages that still remains influential today.
In the early days of the Web, Perl was used to write CGI scripts. CGI stands for Common Gateway Interface and it was one of the first programs that facilitated communication and dynamic interaction between web servers and users.
For example, CGI is often used to process data that has been entered in forms on HTML pages. Currently, Perl has shifted its original focus on text processing and expanded its realm of influence. It is used in network programming, system administration, GUI (graphic user interface) development, and web development. It includes features that support multiple programming models.
Perl’s syntax is similar to C language. C language is a programming language that focuses on procedure and structure. It was used by both operating systems and applications. (However, C++ and Java are replacing it because of their ability to write increasingly popular object-oriented programming.) Perl also draws influence from shell scripts, which function as command line interpreters for operating systems and provide the interface where users make requests.
Perl also contains the elements of ‘awk’, ‘sed’, and ‘grep’. ‘Awk’ is an interpreted programming language developed for manipulating and filtering text. It is included in most versions of UNIX. ‘Sed’ refers to ‘Stream Editor’. It is a UNIX text editor that applies editing commands to entire files. ‘Grep’ is the acronym for ‘global regular expression print’. Grep allows users to search multiple files for particular strings of text and displays all files where the string occurs. Like the other influences, C language emerged from UNIX text editing programs.
While Perl is one of the first scripting languages it continues to thrive in new versions such as Perl 5.8.8. Perl 6 is still in development. Perl is an ‘open source’ program, which means users have access to source code. They can alter it and re-distribute it. It is widely known as the “glue” or “duct-tape” of the Internet. Perl’s greatest contribution is that glue-like function. It makes otherwise uncooperative systems work together and programmers able to creatively choose one of many ways to accomplish their goals.
However, as an older language Perl is being replaced by languages like Python that offer similar features but simpler design. Operating systems that support Perl are UNIX systems, MAC OS 7-9 and X, Windows, and VMS (Virtual Memory System).
PHP stands for “hypertext preprocessor”. It is a free software that builds dynamic web pages. PHP is a reflective language. As a program, it can observe and modify itself at the same time that it is being executed. PHP can run on most web servers and its complete source code is available for free, so users can customize it to their needs.
Its focus is server-side scripting and it can be compared to other languages like ASP.NET by Microsoft and JavaServer Pages (JSPs) by Sun Microsystems in its ability to provide users with dynamic content through web servers. In HTML, PHP is embedded between tags. These tags make it possible to jump between the HTML and PHP.
PHP is the ‘P’ in LAMP architecture. LAMP architecture is a collection of software programs that, together, are used to run dynamic web sites or servers. ‘L’ is for Linux, the operating system. ‘A’ is for Apache, the web server. ‘M’ is for MySQL, the database management system (DBMS) or the database server. ‘P’ stands for PHP, which provides the programming language. (Sometimes the ‘P’ stands for Perl or Python, alternate programming languages.)
The scripting component of LAMP allows users to execute application on web servers through their web browsers. PHP can process text streams easily even if they are coming from different sources. PHP, like other scripting languages, is also referred to as a glue language. Glue languages are used to connect and translate software components.
To make PHP work as server-side scripting, three components are needed: a PHP parser, a programming routine that analyzes and breaks down programming language/sentences into more easily processed functions. PHP parsers are usually CGIs or server modules.
CGIs are the most common way for users to interact with web servers. Server modules are programming modules that provide services to other programs. The other two required components are a web browser and a web server. PHP creates dynamic web content and can send or receive cookies. Cookies are text files sent between the web browser and web server used to analyze user behavior and create customized web content.
Microsoft developed ASPs or active server pages as a server-side scripting engine, an alternative to CGIs and JSPs (Java Server Pages). They are not, in and of themselves, scripting languages, but engines. They are HTML documents embedded with scripting languages like VBScript or JScript.
These script functions are executed on the web server. Their primary responsibility is to create dynamic, interactive user sessions. They allow users to interact dynamically with programs and databases. These sessions are cookie-based and intelligently record user behavior from one page to the next.
Although the primary scripting languages used are VBScript and Jscript, other active scripting engines can be mobilized to interpret functions embedded into HTML with other, compatible, often open source scripts (PerlScript, for example).
The purpose of active scripting as it appears, for example, on Internet Explorer is to automate routine functions. Precisely, the role of scripting languages in ASPs leans heavily toward automation. ASPs can dynamically edit web content, access data and return responses to users, customize user responses, and minimize network traffic.
ASP.NET is the successor to ASPs. It is a Microsoft-produced web application framework developed for its .NET framework. One of the differences with traditional web scripting is the development of event-driven GUIs (graphic user interfaces), where program flow is directed by user action (mouse clicks, keyboard action). Perhaps the greatest benefit of ASP.NET is that it brings object-oriented programming to building web applications. ASP.NET works on the server and separates code from what is displayed.
Therefore, if controls are written in HTML, ASP.NET can interpret these and use, for example, other scripting languages to tell ASP.NET how the designer wants those controls to look and function. ASP.NET also provides strong web services that allow different parts of an application located on different web servers to communicate and operate seamlessly. Finally, ASP.NET offers increased compatibility and interoperability. Each page can be written in different programming languages but when they are collected through ASP.NET on the server, they will also operate seamlessly.