CGIs - PowerPoint PPT Presentation

1 / 11
About This Presentation
Title:

CGIs

Description:

CGI - Common Gateway Interface - a way for web pages to access computer ... Using NotePad/WordPad/Word - simple text editor.. Code Perl Program ... – PowerPoint PPT presentation

Number of Views:438
Avg rating:3.0/5.0
Slides: 12
Provided by: PPB9
Category:
Tags: cgis | wordpad

less

Transcript and Presenter's Notes

Title: CGIs


1
CGIs
  • Server-Side Programming

2
What is a CGI?
  • CGI -gt Common Gateway Interface - a way for web
    pages to access computer programs stored and
    running (key concept!!!) on a web server.
  • PPBHS uses CGIs in Dashboard Page..
  • CGI Programs mainly used for Form Validation,
    E-Commerce, Guest Books, etc...

3
CGIs
  • CGI programs can be written in any programming
    language most written with ASP (Active Server
    Pages - Server-Side JS - Dashboard page - ASP
    only works on UNIX Web Servers), C, or PERL
  • Two Major Types of Web Servers UNIX (Apache)
    Servers and MS IIS (ASP).

4
CGIs
  • We will first learn PERL since we need for the
    commercial sites we are developing -- -gt onednr
    servers -- -gt OCPO, FVINCENT, LENNYSMARKET, and
    TRIC are hosted -gt UNIX Apache Servers.
  • We need Guest Book CGI for FV Bulletin Board for
    OCPO, etc.

5
PERL
  • PERL - Practical Extraction and Report Language -
    high-level, interpreted lang. - not even designed
    for use with web (more info can be found at
    http//www.perl.com) created in 1986 to easily
    create reports
  • PERL is easily ported from OS to another (because
    it is interpreted)

6
PERL
  • Has a rep for being a cool lang
  • and for being fun most of you guys know JS so it
    will be fairly easy for you guys to pick up..

7
PERL
  • How is PERL called out from a HTML
  • Heres is how you via a form
  • ltFORM METHODpost ACTIONhttp//www.lennysmarket.
    com/cgi-bin/bulletin.cgigt
  • Most CGI programs are stored in a directory
    called cgi-bin.

8
PERL Data
  • 3 5 (result is 8)
  • 3 cream (result is 3)
  • ice cream (result 0)
  • ice . cream (result icecream -gt
    concatenation)

9
PERL Data
  • print 3 Main Street (print is the Perl
    function to print back to web page 3 Main
    Street is a constant)
  • variables
  • address3 Main Street
  • print address
  • sum3 5

10
Perl Data
  • Print what is up\ndont know
  • produces what is up
  • dont know
  • print you won prize

11
Creating a PERL CGI Script
  • Using NotePad/WordPad/Word - simple text editor..
  • Code Perl Program
  • Save as text-only file with extension cgi
  • e.g., nick.cgi.
  • Save in servers CGI-BIN Directory
Write a Comment
User Comments (0)
About PowerShow.com