Environment Variables

Slides:



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

CGI Scripting and Vulnerabilities COEN 351: E-commerce Security  Thomas Schwarz, S.J
PHP Form Processing. Using Forms in PHP  Two steps to process  Display the form  Process the submitted data.
How does the server format the information it gives to the appln program? As environment variables and in standard input.
Configuring Apache Server and Perl for CGI T.A. Maisa Khudair Dr. Qusai Abu Ein.
CGI. XML2 Common Gateway Interface n Georgia Tech 1995 Web Usage Survey –Perl % –C % –Shell Scripts - 8.1% –Tcl - Tool Commercial Language.
HTTP Hypertext Transfer Protocol. HTTP messages HTTP is the language that web clients and web servers use to talk to each other –HTTP is largely “under.
How the web works: HTTP and CGI explained
Web Services Nov 26, 2002 Topics HTTP Serving static content Serving dynamic content class27.ppt “The course that gives CMU its Zip!”
Lecture 9, : The Internet, Summer : The Internet Lecture 9: Web Services II David O’Hallaron School of Computer Science and Department.
What is CGI? The Common Gateway Interface (CGI) is a mechanism that allows Web clients to execute programs on a Web server and to receive their output.
CP476 Internet Computing Browser and Web Server 1 Web Browsers A client software program that allows you to access and view Web pages on the Internet –Examples.
Outcomes Know what are CGI Environment Variables Know how to use environment variables How to process A simple Query Form Able to use URL Encoding rules.
CGI Scripts. 2 GET n Form data forms query string and is appended to the URL of the script –Can be accessed by using the environment variable QUERY_STRING.
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.
1 Web Servers Web Protocols and Practice Chapter 4.
Common Gateway Interface
Ch27 - Common Gateway Interface (CGI) and Perl
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.
Overview A plain HTML document is static A CGI program is executed in real-time, so that it can output dynamic information. CGI (Common Gateway Interface)
CP3024 Lecture 3 Server Side Facilities. Lecture contents  Server side includes  Common gateway interface (CGI)  PHP Hypertext Preprocessor (PHP) pages.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
1 Web Server Concepts Dr. Awad Khalil Computer Science Department AUC.
Comp2513 Forms and CGI Server Applications Daniel L. Silver, Ph.D.
Chapter 33 CGI Technology for Dynamic Web Documents There are two alternative forms of retrieving web documents. Instead of retrieving static HTML documents,
CGI Scripting and Vulnerabilities COEN 351: E-commerce Security  Thomas Schwarz, S.J
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
Nic Shulver, Intro: Developing Server Applications What is a server? Many types of server – File server – file: networked file.
Web Server Design Week 14 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 4/14/10.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 21 - Web Servers (IIS, PWS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3.
20-753: Fundamentals of Web Programming Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 7: HTTP and CGI Fundamentals of Web Programming.
CSCE Systems Programming Lecture 21 Web Server: CGI -Dynamic Pages CSCE March 25, 2013.
10/13/2015 ©2006 Scott Miller, University of Victoria 1 Content Serving Static vs. Dynamic Content Web Servers Server Flow Control Rev. 2.0.
CGI programming Peter Verhás January What this tutorial is about Introduction to CGI programming Using ScriptBasic –Simple to program –Simple to.
Chapter 6 Server-side Programming: Java Servlets
ELECTRONIC COMMERCE- Framework, Technologies and Applications © Tata McGraw-Hill 1 Electronic Commerce: Information Publishing Technology.
Perl CGI What is "CGI"? Common Gateway Interface A means of running an executable program via the Web. Perl have a *very* nice interface to create CGI.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
CGI Scripting and Vulnerabilities COEN 351: E-commerce Security.
Form Data Encoding GET – URL encoded POST – URL encoded
Internet and Intranet Fundamentals
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Copyright © 2002 ProsoftTraining. All rights reserved. Java Servlets.
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
Krerk Piromsopa. 1 Department of Computer Engineering. Chulalongkorn University. Web Application Generic Issues.
WEB SERVER SOFTWARE FEATURE SETS
Web Server Design Assignment #5: Unsafe Methods & CGI Due: 05/05/2010 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin.
Introduction to CGI PROG. CGI stands for Common Gateway Interface. CGI is a standard programming interface to Web servers that gives us a way to make.
Web Server Design Week 13 Old Dominion University Department of Computer Science CS 495/595 Spring 2012 Michael L. Nelson 04/03/12.
Web Server Design Week 15 Old Dominion University Department of Computer Science CS 495/595 Spring 2009 Michael L. Nelson 4/20/09.
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)
Web & Web applications DBW 2017.
Web Protocols and Practice
Section 6.3 Server-side Scripting
HTTP – An overview.
Web Development Web Servers.
Warm Handshake with Websites, Servers and Web Servers:
Web Server Design Assignment #5: Unsafe Methods & CGI
CSCE Systems Programming
IS333D: MULTI-TIER APPLICATION DEVELOPMENT
The Request & Response object
Web Privacy Chapter 6 – pp 125 – /12/9 Y K Choi.
Chapter 2 Interacting with the Customer
Web Page Concept and Design :
World Wide Web Uniform Resource Locator hostname [:port]/path
Kevin Harville Source: Webmaster in a Nutshell, O'Rielly Books
The HTTP Protocol COSC 2206 Internet Tools The HTTP Protocol
Web Server Design Week 16 Old Dominion University
Presentation transcript:

Environment Variables

Overview Your CGI or ASP Programs may make use of a “Collection” of variables, variously called ENVIRONMENT or SERVER VARIABLES. Different variables may be set on different servers. Your server logs may be set to record these variables.

To see actual examples: http://parana.ecs.csus.edu/fall02/servervariables.asp http://sequoia.ecs.csus.edu/~harville/cgi-bin/environment.cgi

CONTENT_LENGTH The length in bytes of the returned document. USE: Perhaps the programmer wants to limit the size of the response.

CONTENT_TYPE The type of information returned. Ex: text/html USE: Perhaps the programmer wants to have different parts of the program activate depending on the content type.

DOCUMENT_ROOT The main site directory. USE: Setting up paths for dynamically generated URLs.

GATEWAY_INTERFACE The CGI version number. USE: Perhaps certain program features require a certain CGI version.

HTTP_ACCEPT Media types the client accepts.

HTTP_ACCEPT_ENCODING Methods of compression the browser understands. HTTP_ACCEPT_ENCODING = gzip, deflate

HTTP_ACCEPT_LANGUAGE HTTP_ACCEPT_LANGUAGE = en-us USE: Perhaps different files are to be served up depending on the language of the user.

HTTP_CONNECTION HTTP_CONNECTION = Keep-Alive Every request made requires that the server and client re-introduce each other. Keep-Alive is a switch that allows requests sent within a very short time to avoid this server-client bureaucracy.

HTTP_COOKIE A list of cookies the particular site (or advertising group) has control over. USE: Customer tracking, customization and other honorable or questionable activities.

HTTP_HOST The name of the machine on which the script resides. HTTP_HOST = parana

HTTP_REFERER The page that requested the current document or program. Note the correct misspelling. Referrer would be more correct, but the mistake was made and not corrected. USE: Redirection to a previous page.

HTTP_USER_AGENT The client browser version. Use: Customization or redirection based on browser type (and thus capabilities).

PATH_INFO The current virtual path. PATH_INFO = /chat/servervariables.asp Use: Recording a page name for redirection.

PATH_TRANSLATED The full absolute path on the server. PATH_INFO = /chat/servervariables.asp PATH_TRANSLATED = C:\csc123\chat\servervariables.asp ALSO: APPL_PHYSICAL_PATH = C:\csc123\chat\

QUERY_STRING This variable returns the query string: ?example=Kevin%20Harville USE: Using form or Querystring information.

REMOTE_ADDR The remote IP making the request. USE: Serving up unique pages based on the user. Companies have actually served different pages to their competitors than to their clients.

REMOTE_HOST The remote hostname or IP of the requestor.

REQUEST_METHOD I.e. GET or POST.

SCRIPT_NAME The virtual path of the current script.

SERVER_NAME Server hostname or IP

SERVER_PORT Usually 80 The “channel” incoming requests come in on.

SERVER_PROTOCOL SERVER_PROTOCOL = HTTP/1.1

SERVER_SOFTWARE SERVER_SOFTWARE = Microsoft-IIS/5.0

URL URL = /chat/servervariables.asp

Others Numerous ones exist for SSL HTTP_RAW and ALL_HTTP give long lists of the variables.

Summary Server or Environment Variables are a useful means of site customization. They allow for customers to be tracked, which may or may not be in the customer’s best interest. The allow logging of information.