1 Copyright © 2002 Pearson Education, Inc.. 2 Chapter 2 Getting Started.

Slides:



Advertisements
Similar presentations
Module 3: Block 3 Call Management
Advertisements

1. XP 2 * The Web is a collection of files that reside on computers, called Web servers. * Web servers are connected to each other through the Internet.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Introduction to XHTML Programming the World Wide Web Fourth edition.
AP STUDY SESSION 2.
1
Copyright © 2003 Pearson Education, Inc. Slide 1-1 The Web Wizards Guide to PHP by David A. Lash.
1 Copyright © 2002 Pearson Education, Inc.. 2 Chapter 1 Introduction to Perl and CGI.
© 2008 Pearson Addison Wesley. All rights reserved Chapter Seven Costs.
Copyright © 2003 Pearson Education, Inc. Slide 1 Computer Systems Organization & Architecture Chapters 8-12 John D. Carpinelli.
1 Copyright © 2002 Pearson Education, Inc.. 2 Chapter 4 Working with the Web.
Copyright © 2003 Pearson Education, Inc. Slide 7-1 Created by Cheryl M. Hughes The Web Wizards Guide to XML by Cheryl M. Hughes.
1 Copyright © 2002 Pearson Education, Inc.. 2 Chapter 8 Managing End-User Sessions.
Chapter 1 The Study of Body Function Image PowerPoint
Copyright © 2011, Elsevier Inc. All rights reserved. Chapter 6 Author: Julia Richards and R. Scott Hawley.
Author: Julia Richards and R. Scott Hawley
1 Copyright © 2013 Elsevier Inc. All rights reserved. Chapter 3 CPUs.
Properties Use, share, or modify this drill on mathematic properties. There is too much material for a single class, so you’ll have to select for your.
Manuscript Central Training Author Center Module 2.
UNITED NATIONS Shipment Details Report – January 2006.
Business Transaction Management Software for Application Coordination 1 Business Processes and Coordination. Introduction to the Business.
We need a common denominator to add these fractions.
1 RA I Sub-Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Casablanca, Morocco, 20 – 22 December 2005 Status of observing programmes in RA I.
Local Customization Chapter 2. Local Customization 2-2 Objectives Customization Considerations Types of Data Elements Location for Locally Defined Data.
Create an Application Title 1A - Adult Chapter 3.
Process a Customer Chapter 2. Process a Customer 2-2 Objectives Understand what defines a Customer Learn how to check for an existing Customer Learn how.
Human Service Providers and Referrals Chapter 5. Human Service Providers and Referrals 5-2 Objectives Demonstrate the process for entering a Human Service.
Custom Statutory Programs Chapter 3. Customary Statutory Programs and Titles 3-2 Objectives Add Local Statutory Programs Create Customer Application For.
Custom Services and Training Provider Details Chapter 4.
Rhesy S.ppt proRheo GmbH
1 Click here to End Presentation Software: Installation and Updates Internet Download CD release NACIS Updates.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Windows XP Project An Introduction to Microsoft Windows XP and Office 2003.
1 NatQuery 3/05 An End-User Perspective On Using NatQuery To Extract Data From ADABAS Presented by Treehouse Software, Inc.
© Telcordia Technologies 2004 – All Rights Reserved AETG Web Service Advanced Features AETG is a service mark of Telcordia Technologies. Telcordia Technologies.
PP Test Review Sections 6-1 to 6-6
Bright Futures Guidelines Priorities and Screening Tables
EIS Bridge Tool and Staging Tables September 1, 2009 Instructor: Way Poteat Slide: 1.
Chapter 11: The X Window System Guide To UNIX Using Linux Third Edition.
Exarte Bezoek aan de Mediacampus Bachelor in de grafische en digitale media April 2014.
Copyright © 2012, Elsevier Inc. All rights Reserved. 1 Chapter 7 Modeling Structure with Blocks.
1 RA III - Regional Training Seminar on CLIMAT&CLIMAT TEMP Reporting Buenos Aires, Argentina, 25 – 27 October 2006 Status of observing programmes in RA.
Basel-ICU-Journal Challenge18/20/ Basel-ICU-Journal Challenge8/20/2014.
1..
CONTROL VISION Set-up. Step 1 Step 2 Step 3 Step 5 Step 4.
Services Course Windows Live SkyDrive Participant Guide.
Services Course Windows Live Spaces + Windows Live Writer Participant Guide.
1 How Do I Order From.decimal? Rev 05/04/09 This instructional training document may be updated at anytime. Please visit and check the.
1 BRState Software Demonstration. 2 After you click on the LDEQ link to download the BRState Software you will get this message.
Note to the teacher: Was 28. A. to B. you C. said D. on Note to the teacher: Make this slide correct answer be C and sound to be “said”. to said you on.
Analyzing Genes and Genomes
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Chapter 12 Working with Forms Principles of Web Design, 4 th Edition.
Essential Cell Biology
Intracellular Compartments and Transport
PSSA Preparation.
Essential Cell Biology
A Guide to Unix Using Linux Fourth Edition
Immunobiology: The Immune System in Health & Disease Sixth Edition
Physics for Scientists & Engineers, 3rd Edition
Energy Generation in Mitochondria and Chlorplasts
Murach’s OS/390 and z/OS JCLChapter 16, Slide 1 © 2002, Mike Murach & Associates, Inc.
RefWorks: The Basics October 12, What is RefWorks? A personal bibliographic software manager –Manages citations –Creates bibliogaphies Accessible.
© Paradigm Publishing, Inc Excel 2013 Level 2 Unit 2Managing and Integrating Data and the Excel Environment Chapter 6Protecting and Sharing Workbooks.
Profile. 1.Open an Internet web browser and type into the web browser address bar. 2.You will see a web page similar to the one on.
TCP/IP Protocol Suite 1 Chapter 18 Upon completion you will be able to: Remote Login: Telnet Understand how TELNET works Understand the role of NVT in.
Student Interface for Online Testing Training Module Copyright © 2014 American Institutes for Research. All rights reserved.
FIGURE 3-1 Basic parts of a computer. Dale R. Patrick Electricity and Electronics: A Survey, 5e Copyright ©2002 by Pearson Education, Inc. Upper Saddle.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 6.
Introduction to Programming the WWW I
Presentation transcript:

1 Copyright © 2002 Pearson Education, Inc.

2 Chapter 2 Getting Started

3 Copyright © 2002 Pearson Education, Inc. What You Need to Get Started l Getting the appropriate FTP or Telnet software l Connecting to the Web server l Setting up your directories. l Getting the location of the Perl interpreter.

4 Copyright © 2002 Pearson Education, Inc. Connecting with Telnet l Connect to the Internet Start Telnet. »On a Windows PC start Microsoft Telnet for Windows by clicking Start, Run, telnet. l Connect to your Web server with Telnet. l Log into the server.

5 Copyright © 2002 Pearson Education, Inc. An Initial Telnet Sreen

6 Copyright © 2002 Pearson Education, Inc. Successful Telnet Login

7 Copyright © 2002 Pearson Education, Inc. Connecting with FTP l Connect to the Internet. l Start FTP. l Connect to your Web server with FTP.

8 Copyright © 2002 Pearson Education, Inc. An Initial FTP Login Screen

9 Copyright © 2002 Pearson Education, Inc. A Successful FTP Login Screen

10 Copyright © 2002 Pearson Education, Inc. Navigating UNIX Directories

11 Copyright © 2002 Pearson Education, Inc. Navigating UNIX Directories - 2

12 Copyright © 2002 Pearson Education, Inc. Some UNIX Navigation Commands

13 Copyright © 2002 Pearson Education, Inc. Some UNIX Navigation Commands Unix Commands

14 Copyright © 2002 Pearson Education, Inc. Navigating UNIX Directories with FTP Home dir on web server C:\Temp on PC

15 Copyright © 2002 Pearson Education, Inc. Finding The Location Of Perl l Perl interpreter » A program that translates Perl program commands into commands that are understandable to a computer. »Runs your Perl programs and generates any output. » Its command name is simply perl. »It can be installed in any of several places on a Web server.

16 Copyright © 2002 Pearson Education, Inc. Finding Location Of Perl l Find the location of Perl Interpreter Telnet onto Web Server enter: »which perl »where is perl Perl Interpreter Location

17 Copyright © 2002 Pearson Education, Inc. Starting Your Program Development Process l Each time you develop and run a program: »Create a program file and copy (or save) it into the correct directory. »Change your programs access permissions. »Check your programs syntax. »Run your program.

18 Copyright © 2002 Pearson Education, Inc. Create Your Program File l Editors are computer applications that enable you to create, change, and save files »Microsoft Windows, Notepad is a simple editor that works well for Perl development. »On UNIX systems, the Pico, Vi, and Emacs editors are popular choices. »Will describe the use of Pico on a UNIX Web Server.

19 Copyright © 2002 Pearson Education, Inc. Starting Pico l Telnet into Web Server and enter pico

20 Copyright © 2002 Pearson Education, Inc. Starting Your First Program l Start Editor and enter the following: 1. #!/usr/bin/perl 2. # This program prints out a simple message 3. print Steady Plodding Brings Prosperity\n;

21 Copyright © 2002 Pearson Education, Inc. Program Entered in Pico

22 Copyright © 2002 Pearson Education, Inc. Run The Program l Save the program file on the web server. l Enter the full path to the program file to run. l For example »/home/perlpgm/perl-pgm-www/cgi-bin/simple1.cgi Program File Home Directory Directories On Web Server

23 Copyright © 2002 Pearson Education, Inc. Change the Programs Permissions On A Unix Web Server l UNIX access permissions are used to define the access rights of your files »read permissions define if the file can be read »write permissions define if the file can be changed, » execute permissions define if the file can be executed as a program l You set access permissions for your user ID, your user IDs group, and everyone else

24 Copyright © 2002 Pearson Education, Inc. Use The chmod command

25 Copyright © 2002 Pearson Education, Inc. Use The chmod command

26 Copyright © 2002 Pearson Education, Inc. Change the Programs Permissions On A Unix Web Server »chmod 777 simple1.cgi - end-user and his/her work group and anyone else to read, write, or execute the file simple1.cgi. »chmod 755 simple1.cgi - end-user can read, write, or execute the file simple1.cgi, but everyone else can only read or execute it. »chmod 644 simple1.cgi - you can read or write the file simple1.cgi, but everyone else can only read it. (Good for data files).

27 Copyright © 2002 Pearson Education, Inc. Setting Permissions with FTP on a UNIX Web Server 1. Log into the Web server using the FTP command. 2. Navigate to the appropriate directories on the Web server. 3. Select the file you want to change on your Web server, then right -click it. A drop-down menu will appear. Select FTP commands, and then chmod. (See Next Slide). 4. Select the desired read, write, and execute access permissions for your user ID, your group, and anyone else.

28 Copyright © 2002 Pearson Education, Inc. An FTP Change Permission Screen

29 Copyright © 2002 Pearson Education, Inc. Check and Correct Your Programs Syntax l syntax checking - verifies that program statements are grammatically correct as specified by the program language grammar »Check the syntax of your programs before attempting to run them.

30 Copyright © 2002 Pearson Education, Inc. To Check Your Program Syntax (on a UNIX Web Server) l establish a Telnet session, l navigate to the directory that contains the file, enter perl –c filename, where filename is the program file whose syntax you want to. For example, –cd perl-pgm-www/cgi-bin –perl –c simple1.cgi If no syntax errors then receive: –simple1.cgi syntax OK

31 Copyright © 2002 Pearson Education, Inc. Program with Syntax errors Missing quote mark

32 Copyright © 2002 Pearson Education, Inc. Running Your Program l At least two different ways to run your Perl programs: »Directly on a Web server or PC without a browser »Using your browser over the Internet.

33 Copyright © 2002 Pearson Education, Inc. Running Your Program - On A PC 1. Open a MS-DOS prompt window. »Click Start, Run and then enter command. 2. Run the program. »At the MS-DOS prompt, enter the location of Perl, followed by the location of your program: » C:\Perl\bin\Perl C:\temp\simple1.pl »Perl C:\temp\simple1.pl »You Can also use cd –cd C:\temp –Perl simple1.pl

34 Copyright © 2002 Pearson Education, Inc. Getting Ready to Run Your Program Over the Internet 1. To use a browser over the Internet, add the following MIME content-type line: print Content-type: text/html\n\n;. 1.#!/usr/bin/perl 2.print Content-type: text/html\n\n; 3.# This program prints out a simple message 4.print Steady Plodding Brings Prosperity\n;

35 Copyright © 2002 Pearson Education, Inc. Change Program Process 1. Edit the program 2. Change the program. 3. Save the file. 4. Check the programs syntax. 5. Run the program.

36 Copyright © 2002 Pearson Education, Inc. Running Your Program Over the Internet 1. Connect to the Internet. 2. Start your browser. 3. Enter the URL or Web address to your file 4. Check the programs syntax. 5. Run the program. For example, assume saved the in a file called simple2.cgi in my cgi-bin directory on the Web server. Can execute by the following:

37 Copyright © 2002 Pearson Education, Inc. Output Of Program Executed Over the Internet

38 Copyright © 2002 Pearson Education, Inc. Dealing with Problems l Many Web servers redirect the errors from CGI programs into a separate error log located on the server. »You may receive a generic, cryptic message when running programs with errors. »Two common messages are Internal Server Error (Figure 2.17) and 500 Server Error.

39 Copyright © 2002 Pearson Education, Inc. Some Things to Check l Verify the program syntax. l Verify the access permission. l Verify the file has the proper extension. l Verify the program is stored in the correct directory. l Verify the correct Web address to your program. l Verify the first line has the correct of the Perl interpreter. l Confirm the accuracy of your MIME Content-type line.

40 Copyright © 2002 Pearson Education, Inc. An Internet Server Error

41 Copyright © 2002 Pearson Education, Inc. Generating HTML Statement from Perl Programs 1. #!/usr/bin/perl 2. print "Content-type: text/html\n\n"; 3. print " Example "; 4. print " "; 5. print " This is a Test "; 6. print "A very Interesting test"; 7. print " ";

42 Copyright © 2002 Pearson Education, Inc. Program Output

43 Copyright © 2002 Pearson Education, Inc. Summary l There are several different configurations you can use to develop CGI/Perl programs. »Using FTP and Telent are common l Steps to create a program: create with editor, enter program, set permissions, check syntax, and run the program. l Two statements are required: » First line identifies Perl interpreter location. » Second line specifies the MIME Content-type.