week 1

Aim and purpose

To enable understand and use web server scripting and investigate the common issues surrounding its use

Unit introduction

When designing and building websites, a key issue for developers is the amount of control they can exert over how tasks are carried out. Client-side scripting embedded in web pages can give additional functionality but, because the code is executed after the page has been loaded, there is little control and this approach can lead to hacking vulnerabilities and errors.

Web server scripting is code written ‘server-side’ and executed before the page is loaded. This means that complex tasks can be created and programming is generally more secure. The skills and knowledge developed in this unit are particularly valuable because security and reliability are common issues for businesses.

The types of operation that can be influenced include handling files on the server, security systems such as password protection, and accessing databases. Server scripting can be used for example to gather statistics about the website, including how many visitors have viewed each page. Data such as this can be used to generate revenue from people wishing to advertise on a popular website.

Another function that web server scripting can relate to is the use of environmental arguments. The user’s computer system is scanned to obtain their screen resolution, browser type and other information. Each web page in a website can be made several times to suit a variety of environments. The user is then automatically redirected to the page which best suits their environment. This facility can enhance user enjoyment but has ethical implications if used inappropriately.

Learners will understand the principles of server-side web scripting and be able to create functionality using a web server script. Learners should also understand the security and ethical issues surrounding this area of IT.

Learning outcomes

On completion of this unit a learner should:

1 Understand the principles of web server scripting

2 Be able to use web server scripting

3 Understand the issues affecting web server scripting.

Web server scripting languages:

server-side versus client-side;

What is server-side, and what is client side? 

Server-side scripting is a method where websites servers process or respond to user request an example of such a process would be the login of your favourite social media site, you enter your details on to a form within a webpage that is then sent to the server for it to verify your credentials are correct. Server-side scripts provide an interface to users, and, are used to limit access to coding and access to potential database connections.

Client Side Scripting is a method where the processing of scripts is done on the user's computer that is accessing the website. For example, you are about to purchase an item on Amazon, and you are required to login to your account, the form that you have been presented with is requesting your email address as part of the login, you mistakenly miss out your @ sign from your email, scripts that have been loaded as part of the webpage that is on the users computer will run a check to see if all the required symbols are present, if not a little message is displayed on the screen. No processing has happened on the server at this point this is purely client side. Once the user clicks submit the script could stop the details being sent until the issue is resolved, once it is then the details would be sent to the server.

 

Why should we do it on the client side?

The purpose of using client-side scripts, in this instance, would be to remove the potential load/burden of the server's resources (RAM, CPU) to process simple operations for it to then have to respond back to the users, this can also eat in to a servers bandwidth allocation that it has with an ISP.

web server scripting languages

ASP,  Active Server Pages. Classic ASP was introduced in 1998 as Microsoft's first server side scripting language, pages have the file extension .asp and are normally written in VBScript. In 2002 as a successor to Classic ASP was released named ASP.Net pages have the extension .aspx and are normally written in C# (C sharp).

For further examples to play with, refer to W3Schools, ASP W3Schools

JSP,

PHP:- A recursiveacronym for PHP: Hypertext Preprocessor, it is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML. 

PHP was written in the C programming language by Rasmus Lerdorf in 1994 for use in monitoring his online resume and related personal information. For this reason, PHP originally stood for "Personal Home Page". Lerdorf combined PHP with his own Form Interpreter, releasing the combination publicly as PHP/FI (generally referred to as PHP 2.0) on June 8, 1995. Two programmers, Zeev Suraski and Andi Gutmans, rebuilt PHP's core, releasing the updated result as PHP/FI 2 in 1997. The acronym was formally changed to PHP: HyperText Preprocessor, at this time. Source: http://www.nusphere.com/php/php_history.htm

Cold Fusion,

Perl: - a general-purpose programming language originally developed for text manipulation and now used for a wide range of tasks including system administration, web development, network programming and  GUI development, it was released to usenet's alt.comp.sources in 1987. Perl is licensed under its Artistic License, or the GNU General Public License (GPL).

# Prints the message using two different delimeters.
print "Hello, world!
";
print qq=Did you say "Hello?"
=;

 

Ruby on Rails : - a server-side web application framework written in Ruby under the MIT License. Rails is a model–view–controller(MVC) framework, providing default structures for a database, a web service, and web pages. It encourages and facilitates the use of web standards such as JSON or XML for data transfer, and HTML, CSS and JavaScript for display and user interfacing.  David Heinemeier Hansson extracted Ruby on Rails from his work on the project management tool Basecamp at the web application company also called Basecamp. First released Rails as open source in July 2004.

$ echo "hello, world"
hello, world

 

Django: - a free and open source web application framework, written in Python. A web framework is a set of components that help users to develop websites faster and easier. created in the fall of 2003, when the web programmers at the Lawrence Journal-World newspaper, Adrian Holovaty and Simon Willison, began using Python to build applications. It was released publicly under a BSD license (a family of permissive free software licenses, imposing minimal restrictions on the use and redistribution of covered software.) in July 2005. The framework was named after guitarist Django Reinhardt.

Create an information booklet on the different types of server-side scripting platforms that are available, you in this booklet should look to include examples where possible. Within your booklet, add a section that discusses the strength of using one over the other, in terms of usability and function.

Functionality:

functions

shopping cart,

reserve order,

manage user profile,

web content management,

upload files,

website analysis

 

Coding Time

Create a simple, or use a template webpage and include the below statement in the body area of the code. Note you are also able to just add the below code on its own without the HTML elements.

REMEMBER - as we are dealing with PHP files here we MUST save these as .php files

<?php
echo 'Welcome to my website'
<br/>
<strong>This is my first PHP page.</strong>;
?>

Things to note here are the new tags that you will not have covered in the prior units these are the 

<?php 

and 

?>

These will contain our server-side scripts.

 

Lets look now at the use of variables

<?php
$name = "James";
$surname = "Farrington";

echo 'Welcome to my website my name is $name $surname i hope you like my site';
?>

The code above allows us to use and create variables that we then call in our echo statement that we display to the user on the webpage

 

Remember that as with the Javascripting rules around naming conventions you cannot use a number to start a variable name. so $1name would not be allowed

 

 


Last Updated
2018-04-16 13:27:00

Links to Learning Outcomes

Links to Assessment criteria

P1 explain the principles of web server scripting

M1 compare server-side and client-side scripting

D1 evaluate the combined use of client and web server scripting

 

1 Understand the principles of web server scripting



English


Maths







How 2's Coverage

Traffic Lights - Learners use green, amber and red traffic lights to indicate levels of understanding and to attract support from peers and the teacher.



Anonymous Assessment - Learners assess an anonymous piece of work containing deliberate mistakes against given success criteria.

Files that support this week


| | | | |
Week 1
Prev
Week 2
Prev

Next

Next
Webmaster Spelling Notifications