Mark Dixon, SoCCE SOFT 131Page 1 19 – Web applications: Server-side code (ASP)

Slides:



Advertisements
Similar presentations
Cookies, Sessions. Server Side Includes You can insert the content of one file into another file before the server executes it, with the require() function.
Advertisements

Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation.
Mark Dixon Page 1 16 – Passing Data between pages: Forms, Sessions, & Query Strings.
Mark Dixon, SoCCE SOFT 131Page 1 24 – Web applications: Writing data to Databases using ASP.
1 Chapter 12 Working With Access 2000 on the Internet.
Website Development Registering Users – Introducing Cookies.
ASP Tutorial. What is ASP? ASP (Active Server Pages) is a Microsoft technology that enables you to make dynamic and interactive web pages. –ASP usually.
1 Today: Introduction to ASP- Part 1 Explain the client/server architecture Explain Web-based client/server applications Understand the essentials of Active.
1 Configuring Web services (Week 15, Monday 4/17/2006) © Abdou Illia, Spring 2006.
Mark Dixon, SoCCE SOFT 131Page 1 20 – Web applications: HTML and Client-side code.
Servlets and a little bit of Web Services Russell Beale.
Mark Dixon Page 1 15 – Web applications: Server-side code (ASP)
Mark Dixon, SoCCE SOFT 131Page 1 16 – Web applications: HTML and Client-side code.
Introduction to Active Server Pages
Mark Dixon, SoCCE SOFT 131Page 1 16 – Passing Data between pages: Sessions, Query Strings, & Self Posting.
XP Tutorial 9 New Perspectives on JavaScript, Comprehensive1 Working with Cookies Managing Data in a Web Site Using JavaScript Cookies.
Mark Dixon Page 1 20 – Web applications: Writing data to Databases using ASP.
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
Mark Dixon Page 1 15 – Web applications: Server-side code (ASP)
Mark Dixon, SoCCE SOFT 131Page 1 08 – Web applications: HTML and ActiveX controls.
Mark Dixon, SoCCE SOFT 131Page 1 20 – Web applications: Writing data to Databases using ASP.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
McGraw-Hill/Irwin © 2004 by The McGraw-Hill Companies, Inc. All rights reserved. Beginning Active Server Pages Barry Sosinsky Valda Hilley Programming.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Mark Dixon Page 1 19 – Passing Data between pages: Forms, Sessions, & Query Strings.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Data-Enabled Web Sites: Classibooks.com & Internet Database Technologies Colin Fukai April 4, 2000 Gonzaga University.
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
Tutorial 10 Adding Spry Elements and Database Functionality Dreamweaver CS3 Tutorial 101.
1 Chapter 2 & Chapter 4 §Browsers. 2 Terms §Software §Program §Application.
Copyright 2000 eMation SECURITY - Controlling Data Access with
Working with Cookies Managing Data in a Web Site Using JavaScript Cookies* *Check and comply with the current legislation regarding handling cookies.
Mark Dixon Page 1 3 – Web applications: Server-side code (JSP)
Elements of ASP Documents Adapted from MCDN Web Workshop ( and Webmonkey’s Introduction to Active.
Mark Dixon 1 22 – Web applications: Writing data to Databases using ASP.Net.
Mark Dixon Page 1 23 – Web applications: Writing data to Databases using ASP.
Web Design and Development for E-Business By Jensen J. Zhao Copyright 2003 Prentice Hall, Inc. Web Design and Development for E-Business Jensen J. Zhao.
ASP Introduction Y.-H. Chen International College Ming-Chuan University Fall, 2004.
Creating Databases for Web Applications cookie examples lab time: favorites cookies & Sessions class time for group work/questions on projects Next class:
Chapter 8 Cookies And Security JavaScript, Third Edition.
Mark Dixon 1 18 – Web applications: Server-side code (ASP.Net)
Mark Dixon Page 1 18 – Web applications: Server-side code (ASP)
Mark Dixon, SoCCE SOFT 131Page 1 02 – Dynamic HTML (client-side scripting)
Week seven CIT 354 Internet II. 2 Objectives Database_Driven User Authentication Using Cookies Session Basics Summary Homework and Project 2.
Mark Dixon Page 1 18 – Web applications: Server-side code (PhP)
Mark Dixon 1 03 – Passing Data between pages: Forms, Sessions, & Query Strings.
Lecture Note 1: Getting Started With ASP.  Introduction to ASP  Introduction to ASP An ASP file can contain text, HTML tags and scripts. Scripts in.
11 1 Cookies CGI/Perl Programming By Diane Zak Objectives In this chapter, you will: Learn the difference between temporary and persistent cookies.
Christopher M. Pascucci Basic Structural Concepts of.NET Managing State & Scope.
1 After completing this lesson, you will be able to: Transfer your files to the Internet. Choose a method for posting your Web pages. Use Microsoft’s My.
Mark Dixon Page 1 21 – Web applications: Writing data to Databases using ASP.
Mark Dixon 1 19 – Passing Data between pages: Forms, Sessions, & Query Strings.
Mark Dixon, SoCCE SOFT 131Page 1 02 – Dynamic HTML (client-side scripting)
MOSS Design Presentation -Senior Project-. MOSS MOSS Server System 1. MOSS Application 2. Server 3. Client SIU-E Code Cop System 1. SIU-E.
ASP. What is ASP? ASP stands for Active Server Pages ASP is a Microsoft Technology ASP is a program that runs inside IIS IIS stands for Internet Information.
Mark Dixon, SoCCE SOFT 131Page 1 23 – Web applications: Databases & ASP.
Mark Dixon Page 1 15 – Web applications: Server-side code (ASP)
ASP. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
MIT AITI 2004 JSP – Lecture 4 Sessions and Cookies.
PHP Form Processing * referenced from
ASP – Web Programming Class  Ravi Anand. ASP – Active Server Pages What is ASP? - Microsoft Technology - Can Run using IIS/PWS/Others - Helps us create.
9 – Web applications: Server-side code (ASP)
21 – Web applications: Server-side code (ASP)
18 – Web applications: Server-side code (PhP)
18 – Web applications: Server-side code (ASP)
Dynamic Web Page A dynamic web page is a kind of web page that has been prepared with fresh information (content and/or layout), for each individual viewing.
PHP / MySQL Introduction
The Request & Response object
Introduction to JavaScript
Presentation transcript:

Mark Dixon, SoCCE SOFT 131Page 1 19 – Web applications: Server-side code (ASP)

Mark Dixon, SoCCE SOFT 131Page 2 Session Aims & Objectives Aims –To introduce the fundamental ideas involved in server-side code Objectives, by end of this week’s sessions, you should be able to: –add dynamic server-side functionality, using VB Script

Mark Dixon, SoCCE SOFT 131Page 3 network connection Web Hardware and Software Client Server Browser Application (MS Explorer, Netscape) Web-server Application (MS IIS, Apache)

Mark Dixon, SoCCE SOFT 131Page 4 Request-Response Cycle Browser Application (MS Explorer, Netscape) Web-server Application (MS IIS, Apache) Request Mark Dixon's web site Mark Dixon's web site Welcombe to my web server. Please select from the following list: Soft131: Introduction to programming for Multimedia and Internet applications. Response

Mark Dixon, SoCCE SOFT 131Page 5 Server-side Script (what) ASP – active server pages –executed on server takes time – request-response cycle requires server software (e.g. IIS) –not sent to client secure (can't be viewed by client) –results (response) sent to client pages will NOT work by double clicking on file

Mark Dixon, SoCCE SOFT 131Page 6 Server-side Script (IIS) IIS / personal web server on Windows CD Start, Settings, Control Panel, Add/Remove Programs Add/Remove Windows Components IIS

Mark Dixon, SoCCE SOFT 131Page 7 Enabling/Disabling IIS Start, Settings, Control Panel, Administrative Tools, Internet Services Manager Stop Start

Mark Dixon, SoCCE SOFT 131Page 8 Server-side Script (how) ASP code: –.asp (not.htm) –between –Response object: page sent back to client write method: adds text to response object –Date() function: current date (server) Today's date The date today is <% Response.Write Date() & " " %> The time is currently <% Response.Write Time() & " " %> Date.asp

Mark Dixon, SoCCE SOFT 131Page 9 Form Submission action attribute submit button Login Please login: Username: Password: Login.htm

Mark Dixon, SoCCE SOFT 131Page 10 Form Processing Login <% If Request.Form("txtUserName") = "George" Then Response.Write "Login successful." Else Response.Write "Invalid user name." End If %> LoginCheck.asp

Mark Dixon, SoCCE SOFT 131Page 11 View Source Code executed at server –code is never sent to client View, Source – does not show code:

Mark Dixon, SoCCE SOFT 131Page 12 Code Execution Login <% If Request.Form("txtUserName") = "George" Then Response.Write "Login successful." Else Response.Write "Invalid user name." End If %> LoginCheck.asp Server SW (IIS) Login Invalid user name. Response

Mark Dixon, SoCCE SOFT 131Page 13 Maintaining State between pages Problem –want to protect all pages from unauthorised access –need to store record of successful login Variables –only persist for duration of page

Mark Dixon, SoCCE SOFT 131Page 14 Maintaining State Self Posting Session object –exists for current session –clears if user closes brower –clears after 20 mins of inactivity Cookies –stored on users hard drive –persists between sessions Database/file –stored on server –persists between sessions

Mark Dixon, SoCCE SOFT 131Page 15 Self Posting Multiply <% Dim tmpRes Dim tmpNum1 Dim tmpNum2 If Request.Form("txtNum1") <> "" And Request.Form("txtNum2") <> "" Then tmpNum1 = CDbl(Request.Form("txtNum1")) tmpNum2 = CDbl(Request.Form("txtNum2")) tmpRes = tmpNum1 * tmpNum2 End If %> > Multiply.asp Post to Self Only do calc if first load

Mark Dixon, SoCCE SOFT 131Page 16 Session Object Login <% If Request.Form("txtUserName") = "George" Then Session("LoginOK") = "Yes" Response.Redirect "Home.asp" Else Session.Abandon If Request.Form("txtUserName") <> "" Then Response.Write "Invalid user name, please try again." End If %> Please login: Username: Password: Login.asp Session variable –all strings Abandon method –deletes all session variables Redirect method –redirects browser to specified page

Mark Dixon, SoCCE SOFT 131Page 17 Session Object <% If Session("LoginOK") <> "Yes" Then Response.Redirect "Login.asp" End If %> Home Page Welcome to my home page. Home.asp ASP code to check for successful login