Presentation is loading. Please wait.

Presentation is loading. Please wait.

Section 6.3 Server-side Scripting

Similar presentations


Presentation on theme: "Section 6.3 Server-side Scripting"— Presentation transcript:

1 Section 6.3 Server-side Scripting

2 HTTP Hypertext transfer protocol
Method of transferring pages from web server to the browser Client server model using TCP/IP protocol HTTP client i.e. web browser HTTP server i.e. web server Web browser sends a request message Web server listens on port 80 and responds with a response message Natwest’s online banking URL ‘s’ at the end of the https stands for secure 128-bit encryption through a secure port to Natwest Bank’s computer

3 Web server extension A program that is interpreted by an interpreter running on the web server This extends the functionality of the web server Allows the web server to generate content at the time of the HTTP request e.g. actual time Generates the web page to be returned to the web browser Accesses the request object and processes its contents before formulating a response, which is placed in the response object in the gateway. The web server accesses the response object to pass its contents back to the web browser

4 Common Gateway Interface (CGI)
A gateway between a web server and a web server extension CGI specification tells the server: How to send information to a web server extension What to do after receiving information from a web server extension Consists of two objects, the Request object and the Response object

5 Request Message Web browser sends a request message to web server
Two ways to pass data to web server Query string/Get method Get /webpage.asp?myname=Fred&age=6 Post method Post /webpage.asp Data is passed in the message body

6 Client-side scripting
All the code is already on the users browser and the page alters based on the users input Language is usually JavaScript E.g. A JavaScript drop down menu. The JavasScript alters how the menu is displayed but all the code is run locally while it is doing it.

7 Server-side scripting
This is when the web browser makes a request back to the server and the script creates the dynamic page Language is usually ASP or PHP Can access databases and return results to the browser e.g. user clicks on the products link. The server then runs the ASP code to create a page by finding all the products in the data base. The page is created and sent back to the users browser for viewing.

8 Web browser retrieving data from a remote database

9 Writing server-side scripts
Several scripting languages e.g. VBScript, PHP and Perl. Scripting languages are either interpreted or compiled (executables) ISPs prefer interpreted scripting languages Scripts can be read Less likely to bring down the server Compiled scripts may contain malicious code which could harm the server and computers running web browsers.

10 Active Server Pages Covered by Bernhard Hofmann Also known as ASP
Used to create dynamic web pages Uses VBScript language Interpreted by Microsoft’s Internet Information Server (IIS)

11 Accessing data from a DBMS using server-side scripts
Covered by Bernhard Hofmann Web server extension uses database connection components to connect to a DBMS 5 steps to connect to a DB Create a connection Select a DB Perform DB query Use the returned data Close the connection

12 Class work Install IIS and test server side scripts
Complete the server-side scripting worksheet. The ASP scripts can be tested on your IIS. Try a few of the ASP tutorials at

13 Homework January 2003 CPT 5 Q7 part b only
June 2011 COMP3 Q7 parts d and e only Hand-in by Friday 24th February 2012


Download ppt "Section 6.3 Server-side Scripting"

Similar presentations


Ads by Google