Presentation is loading. Please wait.

Presentation is loading. Please wait.

E-Commerce CMM503 – Lecture 8 Stuart Watt Room C2.

Similar presentations

Presentation on theme: "E-Commerce CMM503 – Lecture 8 Stuart Watt Room C2."— Presentation transcript:

1 E-Commerce CMM503 – Lecture 8 Stuart Watt Room C2

2 Summary of this week Learning outcomes –A basic understanding of server-side scripting, and its main differences from client-side scripting –Able to set up a basic site using Microsofts Internet Information Services –A basic understanding of the Active Server Pages object model

3 Part 1 Server-side scripting and Internet Information Services

4 1 An overview of server-side scripting

5 1.1 Why use server-side scripting? When you want to give users access to a database When you want people to be able to share data with each other When you want pages to be dynamically generated, but when you cannot be completely certain that peoples browsers support JavaScript When you want to deliver more complex behaviour than you can with JavaScript When you want to use more processing power to generate the page than you could reasonably expect the user to have

6 1.2 Main server-side scripting technologies CGI (or: Common Gateway Interface) –Portable, runs outside server, slow PHP (or: PHP: Hypertext Preprocessor) –Portable, good for databases, medium to fast Cold Fusion –Proprietary, portable, good for databases Active Server Pages (or ASP) –Proprietary, Microsoft-specific Java Server Pages (or JSP) –Portable, good for Java code

7 2 Active Server Pages Solves almost all the problems associated with static HTML and client-side scripting. Advantages –It is simple, you only write your code in the HTML page itself. –No compiling, no complex interfacing, quick and easy to update Disadvantages –Mostly Microsoft-specific (although the Apache clone is very good)

8 2.1 Active Server Pages (ASP) Are processed in response to a client request –Server-side scripting Are processed by an ActiveX component –A scripting engine Have the file extension.asp Contains HTML tags and scripting code –Scripts are code between VBScript is the most widely used language –You can also use JavaScript, or even Perl!

9 2.2 ASP ASP provides a server-side scripting environment This includes: –Reading information from an HTTP request –Customising an HTTP response –Storing information about a user –Extracting the capabilities of the users browser

10 2.3 How does ASP work? Client Server Script processor Request Response

11 2.4 ASP Vs (D)HTML The main difference between ASP and (D)HTML pages is the location where the script is run. –HTML, DHTML, or client-side script, is run on the client, in the browser, after the page is sent from the server –ASP, or server-side script, is run on the server before the page is sent to the browser. The Web server processes the script and generates the HTML pages that are returned to the Web browser

12 2.5 Coding: ASP Vs. DHTML Server-side script and client-side script look very similar because they both use the same languages, VBScript, JavaScript, or even Perl. Server side scriptClient side script RGU Home The time here is RGU Home The time here is Document.Write(time()).

13 2.6 Coding: ASP v DHTML In practice, the extended tag makes them even closer! Server side scriptClient side script RGU Home The time here is

Ads by Google