1 Introduction to Perl and CGI David Lash Chapter 1 – Introduction.

Slides:



Advertisements
Similar presentations
Introduction to Web Design Lecture number:. Todays Aim: Introduction to Web-designing and how its done. Modelling websites in HTML.
Advertisements

1 Copyright © 2002 Pearson Education, Inc.. 2 Chapter 1 Introduction to Perl and CGI.
HTML I. HTML Hypertext mark-up language. Uses tags to identify elements of a page so that a browser such as Internet explorer can render the page on a.
4. Internet Programming ENG224 INFORMATION TECHNOLOGY – Part I
Computers: Tools for an Information Age Writing Your Own Web Page: Using HTML and Web Authoring Tools.
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
The World Wide Web. 2 The Web is an infrastructure of distributed information combined with software that uses networks as a vehicle to exchange that.
HyperText Markup Language (HTML). Introduction to HTML Hyper Text Markup Language HTML Example The structure of an HTML document Agenda.
OMT II Mam Saima Gul. * Static web page * a web page with contents that remain fixed and unchanged once it has been created by the author Web server Client.
How To Create A Web Page By: Mikeon Briddy & Darrius Jacobs April 10,2006 Mr. Barnett.
Understand Web Page Development Software Development Fundamentals LESSON 4.1.
Kyung Hee University 1 1 Application Layer. 2 Kyung Hee University Position of Application Layer.
1 HTML Markup language – coded text is converted into formatted text by a web browser. Big chart on pg. 16—39. Tags usually come in pairs like – data Some.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
CIS101 Introduction to Computing Week 05. Agenda Your questions Exam next week - Excel Introduction to the Internet & HTML Online HTML Resources Using.
CIS101 Introduction to Computing Week 05. Agenda Your questions CIS101 Survey Introduction to the Internet & HTML Online HTML Resources Using the HTML.
CIS101 Introduction to Computing
World Wide Web1 Applications World Wide Web. 2 Introduction What is hypertext model? Use of hypertext in World Wide Web (WWW) – HTML. WWW client-server.
Introduction to HTML 2006 CIS101. What is the Internet? Global network of computers that are connected and communicate via a series of Protocols Protocols.
Introduction to HTML 2006 INT197B. What is the Internet? Global network of computers that are connected and communicate via a series of Protocols Protocols.
Introduction to HTML 2004 CIS101. What is the Internet? Global network of computers that are connected and communicate via a series of Protocols Protocols.
HTML Lesson 1 TBE 540 Farah Fisher. Prerequisites Before beginning this lesson, the student must be able to… Access web pages and navigate the web Access.
Guide To UNIX Using Linux Third Edition
Developing a Basic Web Page with HTML
Glencoe Digital Communication Tools Create a Web Page with HTML Chapter Contents Lesson 4.1Lesson 4.1 Get Started with HTML (85) Lesson 4.2Lesson 4.2 Format.
CIS101 Introduction to Computing Week 06. Agenda Your questions Excel Exam during second hour Our status after the snow day Introduction to the Internet.
8/17/2015CS346 PHP1 Module 1 Introduction to PHP.
HTML Tags. Objectives Know the commonly used HTML tags Create a simple webpage using the HTML tags that will be discussed.
Computer Science 101 HTML. World Wide Web Invented by Tim Berners-Lee at CERN, the European Laboratory for Particle Physics in Geneva, Switzerland (roughly.
Presenting Information on WWW using HTML. Presenting Information on the Web with HTML How Web sites are organized and implemented A brief introduction.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Web Design HTML, Frontpage, DreamWeaver μέρος β ΠΡΥ019 - Πληροφορική Δρ.Βάσος Βασιλείου.
Chapter 16 The World Wide Web Chapter Goals ( ) Compare and contrast the Internet and the World Wide Web Describe general Web processing.
Chapter 16 The World Wide Web. 2 The Web An infrastructure of information combined and the network software used to access it Web page A document that.
HTML HTML stands for "Hyper Text Mark-up Language“. Technically, HTML is not a programming language, but rather a markup language. Used to create web pages.
Internet Fundamentals Total Advantage MS Excel 97, Hutchinson, Coulthard, 1998 McGraw Introduction to HTML Chapter 7.
Lecture # 3 HTML and Arrays. Today Questions: From notes/reading/life? From Lab # 2 – Preview of Lab # 2 1.Introduce: How do you make a Web Page?: HTML.
Understanding HTML Code
CP2022 Multimedia Internet Communication1 HTML and Hypertext The workings of the web Lecture 7.
NASRULLAH KHAN.  Lecturer : Nasrullah   Website :
1 CSC 121 Computers and Scientific Thinking David Reed Creighton University HTML and Web Pages.
Section 4.1 Format HTML tags Identify HTML guidelines Section 4.2 Organize Web site files and folder Use a text editor Use HTML tags and attributes Create.
10/5/2015CS346 PHP1 Module 1 Introduction to PHP.
Copyright 2006 South-Western/Thomson Learning Chapter 17 Creating and Linking Web Pages.
HTML Hyper Text Markup Language A simple introduction.
Chapter 8 Introduction to HTML and Applets Fundamentals of Java.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
1 John Magee 9 November 2012 CS120 Lecture 17: The World Wide Web and HTML Web Publishing.
HTML: Hyptertext Markup Language Doman’s Sections.
1 © Copyright 2000 Ethel Schuster The Web… in 15 minutes Ethel Schuster
CPSC 203 Introduction to Computers Lab 33 By Jie Gao.
4 Chapter Four Introduction to HTML. 4 Chapter Objectives Learn basic HTML commands Discover how to display graphic image objects in Web pages Create.
Computational Boot Camp HTML Mike Schaffer. 8/23/2002 (MES) HTML What is HTML? HTML stands for HyperText Markup Language HTML is the language for publishing.
Introduction to HTML. Today’s Discussion What is HTML ? What is HTML ? What is Web Page ? What is Web Page ? Web Server Web Server Web Browser Web Browser.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
HTML HyperText Markup Language. Text Files An array of bytes stored on disk Each element of the array is a text character A text editor is a user program.
NASRULLAH KHAN.  Lecturer : Nasrullah   Website :
HTML CS 105. Page Structure HTML elements control the details of how a page gets displayed. Every HTML document has the following basic structure: … …
Building a Web Page. Create A New Folder  Right click on the desktop and select New / Folder  Name the folder playpen.
XP Review 1 New Perspectives on JavaScript, Comprehensive1 Introducing HTML and XHTML Creating Web Pages with HTML.
Writing Your Own Web Page: Using HTML and FrontPage Chapter 10.
HTML Hyper Text Markup Language. The Basics u HTML documents contain “tags” which instruct the Browser software on how to present the information within.
Web Design Terminology Unit 2 STEM. 1. Accessibility – a web page or site that address the users limitations or disabilities 2. Active server page (ASP)
1 CSC160 Introduction to HTML. 2 What Is a Computer?  A computer is a programmable machine that can store data, interacts with users and devices, and.
HTML And the Internet. HTML and the Internet ► HTML: HyperText Markup Language  Language in which all pages on the web are written  Not Really a Programming.
HTML Structure II (Form) WEEK 2.2. Contents Table Form.
Glencoe Introduction to Web Design Chapter 4 XHTML Basics 1 Review Do you remember the vocabulary terms from this chapter? Use the following slides to.
Section 4.1 Section 4.2 Format HTML tags Identify HTML guidelines
Introduction to Programming the WWW I
Chapter 27 WWW and HTTP.
Presentation transcript:

1 Introduction to Perl and CGI David Lash Chapter 1 – Introduction

2 Course is based on AWL book...

3 Conclusions... l Expect zero previous programming experience. l Expect most people to have some HTML experience. l Assumptions: » Overview HTML but most should master quickly. » Not a “how to program” course but cover Perl basics

4 Course Objectives l Basics of HTML Documents l In-depth description of Perl » Variable use & generating HTML from Perl » Using with HTML Forms » Conditional use » Loops » Arrays (Sequential and Associative) » Regular Expressions » Subroutine Fundamentals » Writing multi-screen web applications » Using cookies

5 Course Expectations l Format: » Meet once a week for 1-2 hours. » Weekly “lab” assignments. » Assignments put up on Web. » A couple of tests

6 Section Objectives l Basics of HTML Documents l Introduction to CGI l Introductory Background On Perl

7 Objectives l Basics of HTML Documents – Accessing Documents Over WWW – What is HTML – Basic Document TAGS – Lists (ordered and non-ordered) – Links – Tables – Publishing Documents l Introduction to CGI l Introductory Background On Perl

8 World Wide Web Background l The World Wide Web (WWW) is a collection of millions of documents and files that are accessible via the Internet l Web browsers are special computer programs that know how to retrieve and display files from the World Wide Web. Can work with Play a file in the wav format (a sound file) Interpret and then display a file in a gif format ( a digital picture file) Interpret and then display a file in the HTML format (a text-based Web page)

9 Accessing HTML Files

10 Objectives l Basics of HTML Documents – Accessing Documents Over WWW – What is HTML – Basic Document TAGS – Lists (ordered and non-ordered) – Links – Tables – Publishing Documents l Introduction to CGI l Introductory Background On Perl

11 HTML? l The Hypertext Markup Language (HTML) uses coded commands called HTML tags that provide instructions to Web browsers indicating how to display each page » It is simple to use and understand » It provides ways to include lots of stuff (e.g., text, graphics, sounds, links) » It is STANDARD » Its creation is one of the big reasons the WWW became popular

12 Displaying HTML

13 Objectives l Basics of HTML Documents – Accessing Documents Over WWW – What is HTML – Basic Document TAGS – Lists (ordered and non-ordered) – Links – Tables – Publishing Documents l Introduction to CGI l Introductory Background On Perl

14 HTML Overview - II l A set of TAGs are required of all HTML documents:... Text is displayed within the BODY tags l The set of HTML tags and text you want to display are stored in a file with either htm or html suffix »E.g., mypage.html or mypage.htm or homepage.html

15 HTML Overview - Example Mypage Welcome to my site. Indicates start and end of HTML document. (Container based.) The header section of document Appears in upper left hand corner of browser window This is where most of TAGS usually are and text your displaying (w/i BODY tags).

16 Displaying HTML Document Title Blue Text Bold and italic Text

17 Paragraph and Break Tags Web Page With "P" Tag Welcome To Exploring The Internet Hopefully you will find this course interesting. In this course, you will develop a broad knowledge of the Internet This class meets at night. CLASS 1 - Introduction To The Internet CLASS 2 - CLASS 3 - HTML Create a new paragraph Create line Line Break Note > 1 tag per line

18 Would Display...

19 Objectives l Basics of HTML Documents – Accessing Documents Over WWW – What is HTML – Basic Document TAGS – Lists (ordered and non-ordered) – Links – Tables – Publishing Documents l Introduction to CGI l Introductory Background On Perl

20 Ordered Lists l For example: This is the first element This is the second line This is the third line l Would look like: 1. This is the first element 2. This is the second line 3. This is the third line List item has start & List is contained in &

21 Unordered Lists l For example, This is the first element This is the second line This is the third line l Would create the following  This is the first element  This is the second line  This is the third line List is contained in & List item has start &

22 Objectives l Basics of HTML Documents – Accessing Documents Over WWW – What is HTML – Basic Document TAGS – Lists (ordered and non-ordered) – Links – Tables – Publishing Documents l Introduction to CGI l Introductory Background On Perl

23 General Link Format l Specified in HTML in the following format: Click Here Anchor tag can be used for links Internet address of file to link to The words displayed for the link

24 Link Examples My Home Page – What is displayed on web page – Page to load when link is clicked

25 Quick Link Example Some Favorite Sites The Mouse The Job And when you go to yahoo you can find anything.

26 Objectives l Basics of HTML Documents – Accessing Documents Over WWW – What is HTML – Basic Document TAGS – Lists (ordered and non-ordered) – Links – Tables – Publishing Documents l Introduction to CGI l Introductory Background On Perl

27 l The bare minimum tags needed to describe a table are Here is a structure for a simple 4 cell table Cell 1 Cell 2 Cell 3 Cell 4 Table Row Table Columns within the row Start & End Table The Basic Table Structure

28 Resulting HTML Output Cell 1 Cell 2 Cell 3 Cell 4

29 Got The Idea? What Would the Following Generate? Cell 1 Cell 2 Cell 1 Cell 2 Cell 3

30 And the Answer is... Cell 1 Cell 2 Cell 1 Cell 2 Cell 3

31 Are You Sure Your Got It? What Would the Following Generate? Cell1 Cell2 Cell ? Cell 1 Cell 2 Cell 3

32 And the Answer is... Cell1 Cell2 Cell ? Cell 1 Cell 2 Cell 3

33 Some Major Table Attributes Some other attributes for the table tag l align=left|right|center - how to align the table\ l valign=left|right|center - vertical alignment of the cell contents within the actual cell l background=URL - sets a graphic image for background l bgcolor="#rrggbb" or color name - sets a color for background or table. l summary=text - a summary text to provide for non-visual browser. l border=# - 0 or no border is the default see below for more details.

34 The Major Table Attributes Some other attributes for the table tag l height=number, percentage - specifies the height (in pixels) of entire window or % of size of current window (See slides below.) l width=number, percentage - specifies the width (in pixels) of entire window or % of size of current window (See slides below.)

35 Got it? l What are 4 HTML TAGS needed in every document? l What 2 HTML tags are used for Bullet lists? l What 3 HTML tags are used for Tables? » »,,,

36 Objectives l Basics of HTML Documents – Accessing Documents Over WWW – What is HTML – Basic Document TAGS – Lists (ordered and non-ordered) – Links – Tables – Publishing Documents l Introduction to CGI l Introductory Background On Perl

37 Some HTML On-line Reference l - World wide web consortium l - HTML tutorial information. l - HTML cheatsheet

38 Objectives l Basics of HTML Documents l Introduction to CGI » What is CGI? » Sequence of steps to retrieve a file. » Advantages and Disadvantages of CGI. l Introductory Background On Perl

39 Web Application Program l HTML is a static technology l Web application programs help with dynamic tasks, such as: » Input a search term, search the WWW, and return the results » Calculate and display the number of times that a page has been viewed » Verify the input fields on a Web form » Save a Web form into a database » Display a special graph, or return the results of a calculation based on data input from a form l Problem: How do you start the program and include program results in HTML document?

40 The Common Gateway Interface l a standard that enables Web browsers to exchange data with computer programs located on a Web server l first appeared in the NCSA HTTPD Web server software built by the National Center for Super- computing Applications (NCSA). » one of the first widely used Web servers. » was simple and the program source code was made available for free. » Back in the “old” days (1994) it was the only option. l It is simple to use and available on a variety of Web servers.

41 How Web Apps Work w/ CGI

42 How Web Apps Work w/ CGI

43 Compare to Embedded HTML Tech

44 Advantages/Disadvantages of CGI l Adv - Works with lots of different prog languages: Perl, VB, C, C++, Java, UNIX shell » CGI Programs - Web application programs that are developed specifically to work with the CGI standard are known as CGI programs. l Adv - Web Servers - Available on most Web Servers (E.g, Apache (Open Software), IIS, Netscape’s Iplanet. l Adv - Availability - Can ISP that enable CGI program development. l Disadv - Speed - Can be slow to start up separate language environment. Esp. for apps with lots of hits. l Disadv - Start-up - A little more to do than embedded languages

45 Objectives l Basics of HTML Documents l Introduction to CGI » What is CGI? » Sequence of steps to retrieve a file. » Advantages and Disadvantages of CGI. l Introductory Background On Perl

46 The Perl Programming Language l Practical Extension and Reporting Language » Invented in 1987 by Larry Wall at NASA’s Jet Propulsion Laboratory » Developed as a utility programming language for the UNIX operating system » Gained popularity because of its ease of use, free availability via the Internet, and its powerful combination of features

47 Why Perl is Popular l Perl is a free language with lots of free applications - Open source project. l Perl is easier to work with than many other languages l Perl provides a CGI interface module l Perl applications are portable (can port across Microsoft/UNIX barrier) » Note: Perl is also includes a combination of UNIX and C features. For example, file I/O, general statement format, regular expressions. l Perl (and CGI) is readily available in many environments.

48 Summary l Web pages written in HTML are static and cannot interact with users. l CGI is an interface standard that allows computer programs to communicate with Web servers. Several programming languages can be used with CGI.

49 Summary - II l Perl is a popular computer language that can be used for developing CGI programs. l You can install Perl and your own Web server software on your PC or workstation. l If you use an ISP’s Web server, find out several things about its services.

50 Chapter 1 - On-line Reference l - Background about the Perl language and free downloads of Perl. l - World wide web consortium l - Timeline history of the Perl. l - NCSA sitie l ng/ - Discussion about alternative web application programming environments like Perl, ASP, and PHP. l - Apache web server open software site with free downloads.

51 Got it? l What is the difference between CGI and Perl? l List the steps involved when a Web browser interacts with a static Web Page. »Request a Web Page URL »Find server over Internet »Web server gets file »Returns over Internet »Browser Interprets the HTML »CGI is an interface standard between the web server and application program environment. Perl is a programming language.

52 Got it? l List the steps involved when a Web browser interacts with a CGI/Perl Web application? »Request a Web Page URL »Find server over Internet »Web server gets file »Starts program environment and uses CGI to send data »Returns results over Internet »Browser Interprets the HTML