 Previous lessons have focused on client-side scripts  Programs embedded in the page’s HTML code  Can also execute scripts on the server  Server-side.

Slides:



Advertisements
Similar presentations
DT228/3 Web Development WWW and Client server model.
Advertisements

Session 6 Server-side programming - ASP. An ASP page is an HTML page interspersed with server-side code. The.ASP extension instead of.HTM denotes server-side.
JavaScript Forms Form Validation Cookies CGI Programs.
Forms Describe common uses of forms on web pages
Apache Tomcat Server – installation & use Server-side language-- use Java Server Pages Contrast Client-side languages HTML Forms Servers & Server-side.
Introduction to Web Interface Technology (CSE2030)
Multiple Tiers in Action
Apache Tomcat Server Typical html Request/Response cycle
CS 898N – Advanced World Wide Web Technologies Lecture 6: PERL and CGI Chin-Chih Chang
Introduction to Web Interface Technology (CSE2030)
Website Development with PHP and MySQL Introduction.
Chapter 11 ASP.NET JavaScript, Third Edition. 2 Objectives Learn about client/server architecture Study server-side scripting Create ASP.NET applications.
Using Entities & Creating Forms Jill R. Sommer Institute for Applied Linguistics Kent State University.
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
Chapter 10 Form Basics Key Concepts Copyright © 2013 Terry Ann Morris, Ed.D 1.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
CST JavaScript Validating Form Data with JavaScript.
Server Side Scripting Norman White. Where do we do processing? Client side – Javascript (embed code in html) – Java applets (send java program to run.
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
August Chapter 1 - Essential PHP spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science and Technology.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Chapter 9 Using Perl for CGI Programming. Computation is required to support sophisticated web applications Computation can be done by the server or the.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Introduction to PHP and Server Side Technology. Slide 2 PHP History Created in 1995 PHP 5.0 is the current version It’s been around since 2004.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Dr. Azeddine Chikh IS444: Modern tools for applications development.
Comp2513 Forms and CGI Server Applications Daniel L. Silver, Ph.D.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
© 2011 Delmar, Cengage Learning Chapter 9 Collecting Data with Forms.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
USING PERL FOR CGI PROGRAMMING
Website Design Lecture 1. Outline Introduction to the module Outline of the Assessment Schedule Lecture Static XHTML, client side and server side Why.
Chapter 8 Cookies And Security JavaScript, Third Edition.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
 2003 Prentice Hall, Inc. All rights reserved. CHAPTER 3 JavaScript 1.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Website Development with PHP and MySQL Saving Data.
CGI Programming. What is it? CGI –Common Gateway Interface Standard way to pass information back to the Web Server –GET Query String –POST Standard Input.
Introduction to ASP.NET1. 2 Web applications in general Web applications are divided into two parts –The server part –The client part The server part.
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
Week 9 - Form Basics Key Concepts 1. 1.Describe common uses of forms on web pages 2.Create forms on web pages using the form, input, textarea, and select.
Approaches for creating dynamic web pages Server-side processing: Server receives a request, performs all processing necessary to create a dynamic web.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Web Development & Design Foundations with XHTML Chapter 9 Key Concepts.
JSON and A Comparison of Scripts. JSON: JavaScript Object Notation Based on a subset of the JavaScript Programming Language provides a standardized data.
Active Server Pages Server-Side Scripting and Client-Side Scripting.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
Scripting Languages Client Side and Server Side. Examples of client side/server side Examples of client-side side include: JavaScript Jquery (uses a JavaScript.
Introduction and Principles Web Server Scripting.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
HTML III (Forms) Robin Burke ECT 270. Outline Where we are in this class Web applications HTML Forms Break Forms lab.
Lesson 11. CGI CGI is the interface between a Web page or browser and a Web server that is running a certain program/script. The CGI (Common Gateway Interface)
Ashima Wadhwa Java Script And Forms. Introduction Forms: –One of the most common Web page elements used with JavaScript –Typical forms you may encounter.
Server Side Scripting Key Points Meaning of ? In URL Arguments/inputs: name/value pairs, & separates Create/abuse input in the URL Input validation (server.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Section 6.3 Server-side Scripting
Introduction to CGI and ajax
Introduction to CGI and ajax
JavaScript: Introduction to Scripting
Presentation transcript:

 Previous lessons have focused on client-side scripts  Programs embedded in the page’s HTML code  Can also execute scripts on the server  Server-side scripts  Programs that the web server runs in response to something done by a web client (browser)  Common server-side languages and extensions  Perl Common Gateway Interface (CGI) –.pl,.cgi  PHP –.php  Active Server Pages (ASP) –.asp  ASP.NET –.aspx  JavaServer Pages (JSP) –.jsp  ColdFusion –.cfm 2Server-Side Scripting

 Client requests a page containing JavaScript code  GET ex0.html HTTP/1.1  Server returns an HTML file containing embedded JavaScript var iter = 0; while(iter < 1000) { document.write("G O N A V Y ! "); iter = iter + 1; }  Client renders the page  Includes executing the embedded JavaScript Server-Side Scripting3

 Client requests a page containing JavaScript code  GET ex0.jsx? HTTP/1.1  Server executes the JavaScript code and generates the HTML content  Client receives HTML and renders it Server-Side Scripting4

 Two mechanisms for sending arguments to server-side scripts  GET  POST  GET provides inputs to the server as part of the URL  Simpler  POST provides inputs to the server “behind the scenes” Server-Side Scripting5

 Example URL  URL for script ends with “ ? ”  Designates the start of the querystring  Querystring consists of name=value pairs  name=value pairs are parameters the server-side script will use as inputs  Multiple name=value pairs separated by “ & ”  arg1=value1&arg2=value2  Specify the action and method attributes in the form element  action specifies the script to use  method specifies either GET or POST  Server-Side Scripting6

 Server-side scripts execute on the remote server  Uses server resources  Can cause problems for a server administrator  Performance  Security  Validation and sanitization help ensure valid input is supplied to a program  Validation: checks if the input meets a set of criteria  Sanitization: modifies the input to ensure that it is valid Server-Side Scripting7

 Testing for the length  Format  Range  Allowable characters  Example  Program expects positive integer input  Validate that any string input consists only of the digits 0 through 9 Server-Side Scripting8

 Attempt to parse a valid value from the provided input  Strip the invalid content from the input  Re-format the input  Escape characters so they cannot be interpreted as code  Use a default value Server-Side Scripting9

 Assume a script that writes “GO NAVY!” a user-specified number of times  gonavy.jsx?n=800  What if the user wants to print “GO NAVY” 100,000,000 times?  What if multiple users want to do so? Server-Side Scripting10

 For performance reasons, we may want to limit users to N=5000  Validate the user input  A number  If not a number, set to a default value of 100  Less than 0  If < 0, set value to 0  Greater than (or equal to) 5000  If > 5000, set value to 5000 Server-Side Scripting11