Advanced Commercial Web Site Design: ServerSide Scripting - PowerPoint PPT Presentation

1 / 24
About This Presentation
Title:

Advanced Commercial Web Site Design: ServerSide Scripting

Description:

As a collection of tools, PHP is really a collection of modules managed ... http://academ.hvcc.edu/~kantopet/php/index.php?page=php history&parent=what is php ... – PowerPoint PPT presentation

Number of Views:329
Avg rating:3.0/5.0
Slides: 25
Provided by: Gan58
Category:

less

Transcript and Presenter's Notes

Title: Advanced Commercial Web Site Design: ServerSide Scripting


1
Advanced Commercial Web Site Design Server-Side
Scripting
  • Session 2-1
  • Introduction to Server-side Programming

2
Outline
  • History
  • Static vs. Dynamic web pages
  • PHP and server-side scripting
  • Applications
  • Other server-side solutions
  • Before the coding

3
History 1
  • PHP was created by Rasmus Lerdorf in 1994.
  • It started as a collection of Unix-specific HTTP
    server modules, or tools, designed to assist in
    the maintenance of a small Web site.
  • PHP stands for 2
  • Personal Home Page
  • PHP Hypertext Preprocessor

4
History (cont.)
  • As a collection of tools, PHP is really a
    collection of modules managed by a central PHP
    parser. The modules that make up PHP are written
    in C.
  • Since PHP is open source, if you are a competent
    C-programmer you can modify or add to PHP to suit
    your needs.
  • The original version of PHP was designed
    primarily to handle usage logging and server-side
    form generation. It was not a scripting language,
    just a set of server tools to help Mr. Lerdorf
    with web site maintenance. Finding these tools to
    be useful, in June of 1995 he posted information
    on the modules to UseNET for others who might be
    interested in them.

5
History (cont.)
  • About the same time, Rasmus Lerdorf began working
    on a large Web-based project for the University
    of Toronto. The project required the ability to
    pull data in from diverse sources and to provide
    a Web-based administrative interface for the
    system. He saw PHP as an ideal base to develop
    the tools he needed. The result was PHP 2.
  • PHP 2 went beyond logging utilities and became
    what Mr. Lerdorf himself called a "Server-side
    Embedded Scripting Language". This shift was in
    response to market demand. People didn't want to
    have to write new C-modules every time they had
    to do something new. Instead they wanted to be
    able to embed the logic directly into their Web
    pages.

6
History (cont.)
  • PHP 3 was released in 1998 and was the first
    multi-platform version. (Previous versions had
    been Unix only). It expanded database support to
    include ODBC data sources, included a revamped C
    API, and added support for various e-mail
    protocols, including SNMP and IMAP.
  • With the release of PHP 4 in 2000, the
    architecture of the language had been entirely
    revamped. PHP was abstracted from the Web server,
    which is to say it became an independent
    component running on the server that was entirely
    divorced from the server architecture. The
    parsing process was improved for greater
    efficiency and security.

7
Today
  • PHP 5 was released in July 2004 after long
    development and several pre-releases. It is
    mainly driven by its core, the Zend Engine 2.0
    with a new object model 3.
  • Our server is currently running stable PHP
    version 4.4.5(consult your info.php page for
    more information)

8
What is PHP?
  • PHP is a HTML-embedded scripting language.
  • PHP is a server side HTML scripting/programming
    language.
  • PHP is a tool that lets you create dynamic web
    pages. PHP-enabled web pages are treated just
    like regular HTML pages and you can create and
    edit them the same way you normally create
    regular HTML pages.

9
Static vs. Dynamic web pages
  • Normally web pages are created as HTML documents
    and made available on a web server. The content
    of the page does not change until the author
    creates and uploads a new version. These are
    known as static pages.
  • Many applications of server-side scripts involve
    using databases to produce web pages with dynamic
    content. A dynamic page contains information
    which is generated, often based on data retrieved
    from a database, only when the user requests the
    page.
  • Dynamic pages are useful when much of content of
    the site changes frequently and when user
    transactions are needed. Static pages are simpler
    to implement, and are suitable for sites where
    the content does not change often.

10
Client-side scripting
  • When you access a web page using your browser,
    the web page is sent from the server computer
    where it is stored to the client computer, which
    is the computer your browser is running on.
    JavaScript, Java applets and Flash provide ways
    of putting interactive features in web pages
    which could not be done using HTML alone. These
    are executed on the client.
  • Limitations
  • Download time.
  • Browser compatibility.
  • Visible code since JavaScript and VBScript code
    is included in the HTML page, then anyone can see
    the code by viewing the page source.
  • Possible security hazards for the client
    computer.

11
Server-side scripting
  • Alternatively, programs and scripts can be run on
    the server.
  • Benefits
  • Programs run on a known computer not dependent
    on browser.
  • Greater flexibility in what scripts can do e.g.
    access databases, modify files on server.
  • Code is not viewable by users.
  • Limitations
  • You must have your site on a server which is
    capable of running your scripts, and permission
    to create your own scripts.
  • Can sometimes be slower to run than client side
    since server access is required.

12
PHP server-side scripting
  • This is the most traditional and main target
    field for PHP. You need three things to make this
    work.
  • The PHP parser (CGI or server module),
  • a web server and
  • a web browser.
  • You need to run the web server, with a connected
    PHP installation. You can access the PHP program
    output with a web browser, viewing the PHP page
    through the server.

13
PHP server-side scripting
14
Advantages
  • Attractive points of PHP are
  • It is Open Source and so has a low development
    cost, and
  • Support and assistance are readily available
    through the active and helpful PHP Community.
  • Cross-platform

15
Applications
  • The most common application of PHP is,
    undoubtedly, web-based applications utilizing
    databases.
  • PHP has an excellent interface to the Open Source
    database, MySQL, which means that developers can
    utilize these tools easily and effectively to
    create fast web applications.
  • PHP provides support for many other databases as
    well, including SQL Server, Oracle and MS Access.
    It has proven to be a viable and stable solution
    for everything from personal to corporate to
    E-commerce web sites.

16
Applications (cont.)
  • It also comes with a wide range of other features
    such as XML support, Java servlet support,
    native session handling and IMAP functions
    amongst others.
  • As well as being easy to pick up it offers many
    advanced functions that experienced developers
    will appreciate.
  • Graphics
  • File/Directory handling
  • PDF and ZIP file manipulation

17
Other server-sidescripting languages
  • Active Server Pages (ASP)
  • Java Server Pages (JSP)
  • Common Gateway Interface (CGI)
  • ColdFusion
  • A comparison of PHP and other languages can be
    found at 4

18
Active Server Pages - ASP/.Net
  • Advantages
  • Ease of learning for non-developers
    Integration with existing Microsoft Products
    Ease of extension via COM objects Comes free
    with most Windows operating systems Developed
    by Microsoft
  • Disadvantages
  • - Strongest in a Windows environment, weaker on
    Unix or other platforms - Developed by Microsoft
    (licensing)

19
Java Server Pages - JSP
  • Advantages
  • Strong integration with JavaBeans and other
    elements Ease of use for experienced Java
    developers Rapid Application Development
    Adept scaling to heavy loads Cross-platform
    compatibility Open Source availability
  • Disadvantages
  • - Slower speed due to being more strict and
    robust (JSP pages often run slower than similar
    pages using technologies such as PHP, for
    example)- Steeper learning curve when compared
    to many other technologies

20
Common Gateway Interface - CGI
  • Advantages
  • Ability to write in a multitude of languages
    Speed and efficiency Powerful and robust
    nature Ability to compile or interpret as
    appropriate Cross-platform compatibility
  • Disadvantages
  • - Steeper learning curve than newer
    technologies- Decrease in available resources
    associated with, becoming more and more old
    fashioned- Slower running speed as opposed to
    newer technologies

21
ColdFusion from Macromedia
  • Advantages
  • Simple to learn and use, fast application
    development time Cross-platform - currently
    supported on Solaris, Linux, Windows, HP-UX with
    code compatibility between platforms
    Comprehensive feature set including built in
    graphing and charting functions, and Verity
    search engine Scales well to heavy loads Well
    supported by authoring tools Well documented
  • Disadvantages
  • - ColdFusion's core features are extensive,
    simple and effective. But extending its features
    can involve added complexity- Costs more than
    competing platforms. A freeware version is
    available, but the features are limited.

22
Before the coding IDE for PHP
  • IDE (Integrated Development Environment )
  • Zend Studio (www.zend.com)
  • Zend Studio 5 is the only Integrated Development
    Environment (IDE) available for professional
    developers that encompasses all the development
    components necessary for the full PHP application
    lifecycle. Through a comprehensive set of
    editing, debugging, analysis, optimization and
    database tools, Zend Studio 5 speeds development
    cycles and simplifies complex projects.
  • PHPEclipse Plugin for Eclipse
  • http//www.eclipse.org
  • http//www.phpeclipse.de/tiki-view_articles.php
  • Macromedia Dreamweaver

23
Before the coding Install PHP
  • Requirements
  • Web Server (Apache)
  • http//httpd.apache.org/download.cgi
  • PHP4
  • http//www.thesitewizard.com/archive/php4install.s
    html
  • MySQL (Optional)
  • http//dev.mysql.com/doc/refman/5.0/en/windows-ins
    tallation.html

24
References
  • http//academ.hvcc.edu/kantopet/php/index.php?pag
    ephphistoryparentwhatisphp
  • http//www.acronymfinder.com/af-query.asp?pdictS
    tringexactAcronymPHP
  • http//www.php.net/manual/en/migration5.phpmigrat
    ion5.changes
  • http//www.php.net/manual/en/faq.languages.php
Write a Comment
User Comments (0)
About PowerShow.com