0% found this document useful (0 votes)
52 views

Introduction To Webapps

This document provides an introduction to web development. It discusses the history and origins of the World Wide Web and HTML. It describes the basic components of websites like URLs, domains, web servers, and browsers. It explains how web pages are created using HTML and CSS. It also covers client-server architectures, JavaScript, server-side scripting with PHP, and publishing websites using FTP and domain registration.

Uploaded by

Denny England
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

Introduction To Webapps

This document provides an introduction to web development. It discusses the history and origins of the World Wide Web and HTML. It describes the basic components of websites like URLs, domains, web servers, and browsers. It explains how web pages are created using HTML and CSS. It also covers client-server architectures, JavaScript, server-side scripting with PHP, and publishing websites using FTP and domain registration.

Uploaded by

Denny England
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 60

Drupal Module Development

Introduction to Web Development


In 1990 and 1991,Tim Berners-Lee created the
World Wide Web at the European Laboratory for Particle Physics (CERN) in Geneva, Switzerland The original purpose of the World Wide Web (WWW) was to provide easy access to crossreferenced documents that existed on the CERN computer network Hypertext linking allows you to quickly open other Web pages

PHP Programming with MySQL

Introduction to Web Development (cont)


A document on the Web is called a Web page A Web page is identified by a unique address
called the Uniform Resource Locator (URL) A URL is also commonly referred to as a Web address A URL is a type of Uniform Resource Identifier (URI) A Web site refers to the location on the Internet of the Web pages and related files

PHP Programming with MySQL

Introduction to Web Development (cont)


Web pages are displayed using a program
called a Web browser A Web server is a computer that delivers Web pages The most popular Web server software is Apache HTTP Server (Apache) The second most popular Web server is Microsoft Internet Information Services (IIS) for Windows

PHP Programming with MySQL

HTML Documents
Web pages are created using Hypertext Markup
Language (HTML) Web pages are commonly referred to as HTML pages or documents A markup language is a set of characters or symbols that define a documents logical structure HTML is based on an older language called Standard Generalized Markup Language (SGML)

PHP Programming with MySQL

HTML Documents (cont..)


Like SGML, HTML was originally designed as a
way of defining the elements in a document independent of how they would appear HTML has evolved into a language that defines how elements should appear in a Web browser Understanding HTML is critical in learning how to write a web application along with the server programming

PHP Programming with MySQL

Basic HTML Syntax


HTML documents are text documents that
contain formatting instructions called tags HTML tags include:
Formatting commands (boldface or italic) Controls that allow user input (option buttons or check boxes)

Tags are enclosed in brackets (< >) and consist


of an opening tag and a closing tag Tutorial for learning HTML
http://www.w3schools.com/html

PHP Programming with MySQL

Web Communication Protocols


A Web page is identified by a unique address
called the URL Each URL consists of two basic parts:
A protocol (usually HTTP) and Either the domain name for a Web server or a Web servers Internet Protocol address

Hypertext Transfer Protocol (HTTP) manages


the hypertext links that are used to navigate the Web

PHP Programming with MySQL

Web Communication Protocols (cont..)


A host refers to a computer system that is being
accessed by a remote computer A domain name is a unique address used for identifying a computer such as a Web server on the Internet The domain identifier identifies the type of institution or organization (.biz, .com, .edu, .org) An Internet Protocol, or IP address, is another way to identify computers or devices connected to the Internet

PHP Programming with MySQL

Web Communication Protocols (cont..)


An IP address consists of a series of four groups
of numbers separated by periods Each Internet domain name is associated with a unique IP address HTTP is a component of Transmission Control Protocol/Internet Protocol (TCP/IP) Hypertext Transfer Protocol Secure (HTTPS) provides secure Internet connections for transactions that require security and privacy

10

PHP Programming with MySQL

Web Communication Protocols (cont..)


http://www.google.com/help/index.html
Protocol Domain name Directory Filename

11

PHP Programming with MySQL

Publishing Your Web Site


Web Hosting:
The publication of a Web site for public access Internet access (cable modem, DSL, satellite, dial-up modem, ISP)

Internet Service Provider (ISP):


Provides access to the Internet along with other types of services such as e-mail

12

PHP Programming with MySQL

Publishing Your Web Site (cont..)


ISP advantages to hosting a Web site:
Extremely fast Internet connections using advanced fiber-optic connections Large and powerful Web servers and the expertise and manpower to maintain and manage them

A domain name is a unique address used for


identifying a computer, such as a Web server on the Internet

13

PHP Programming with MySQL

Publishing Your Web Site (cont..)


Domain name registration
Pick a domain name that is similar to your business name or that describes your Web site You cannot use a domain name that is already in use or a trademarked name Contact a domain name registrar to find out the availability of a domain name and register it Domain names are stored in a master database that is maintained by the InterNIC

14

PHP Programming with MySQL

Publishing Your Web Site (cont..)


Domain name registration (continued)
For a fee, domain names can be registered for a specified period of time Most hosting sites provide registration service for you After you register your domain name, notify your ISP of your domain information

15

PHP Programming with MySQL

Publishing Your Web Site (cont..)


File Transfer Protocol (FTP)
Is a TCP/IP protocol used for transferring files across the Internet Transfers files between an FTP client (your computer) and an FTP server (a server capable of running FTP) The vehicle that allows you to get your Web page files to the Web server

16

PHP Programming with MySQL

Publishing Your Web Site (cont..)


File Transfer Protocol (continued)
Your ISP provides a username and password to log on to the FTP site and upload files to the FTP server Examples of FTP clients include Firefox and Internet Explorer and WinScp
Use your browser to log on to an FTP server and upload your files

17

PHP Programming with MySQL

Cascading Style Sheets


A single piece of CSS formatting information,
such as text alignment, is referred to as a style The term cascading refers to the ability for Web pages to use CSS information from more than one source

18

PHP Programming with MySQL

Cascading Style Sheets (continued)


CSS properties:
CSS styles are created with two parts separated by a colon The property refers to a specific CSS style The value assigned to it determines the styles visual characteristics Together, a CSS property and the value assigned to it are referred to as a declaration or style declaration

19

PHP Programming with MySQL

Cascading Style Sheets (continued)


Inline Styles
Allow you to add style information to a single element in a document

Internal Style Sheets


Create styles that apply to the entire document P { color : blue }
selector property value

External Style Sheets


A separate text document containing style declarations that are used by multiple documents on a Web site

20

PHP Programming with MySQL

Understanding Web Development


Web development, or Web programming, refers
to the design of software applications for a Web site The Webmaster is responsible for:
The day-to-day maintenance of a Web site Monitoring Web site traffic and ensuring that the Web sites hardware and software are running properly Knowledge of Web page design, authoring, and development

21

PHP Programming with MySQL

Client/Server Architecture
Server (back end):
A database from which a client requests information Fulfills a request for information by managing the request or serving the requested information to the client Responsible for data storage and management

A system consisting of a client and a server is


known as a two-tier system

22

PHP Programming with MySQL

Client/Server Architecture (cont..)


Client (front end):
Presents an interface to the user Gathers information from the user, submits it to a server, then receives, formats, and presents the results returned from the server

23

PHP Programming with MySQL

Client/Server Architecture (continued)


A three-tier, or multi-tier, client/server system
consists of three distinct pieces:
Client tier, or user interface tier, is the Web browser Processing tier, or middle tier, handles the interaction between the Web browser client and the data storage tier
Performs necessary processing or calculations based on the request from the client tier Handles the return of any information to the client tier

24

PHP Programming with MySQL

Client/Server Architecture (cont..)

Figure 1-16 The design of a three-tier client/server system

25

PHP Programming with MySQL

JavaScript and Client-Side Scripting


JavaScript is:
A client-side scripting language that allows Web page authors to develop interactive Web pages and sites Used in most Web browsers including Firefox and Internet Explorer

Client-side scripting is a language that runs on


a local browser (on the client tier) instead of on a Web server (on the processing tier)

26

PHP Programming with MySQL

JavaScript and Client-Side Scripting (continued)


JavaScript allows you to:
Turn static Web pages into applications such as games or calculators Change the contents of a Web page after a browser has rendered it Create visual effects such as animation Control the Web browser window itself

27

PHP Programming with MySQL

Server-Side Scripting and PHP


Server-side scripting refers to a scripting language that
is executed from a Web server Hypertext Preprocessor (PHP) is a server-side scripting language that is used to develop interactive Web sites
Is easy to learn Includes object-oriented programming capabilities Supports many types of databases (MySQL, Oracle, Sybase, ODBC-compliant)

28

PHP Programming with MySQL

Server-Side Scripting and PHP (cont..)


PHP (continued):
PHP is an open source programming language
Open source refers to software where source code can be freely used and modified

Cant access or manipulate a Web browser like JavaScript Exists and executes solely on a Web server, where it performs various types of processing or accesses databases

29

PHP Programming with MySQL

Server-Side Scripting and PHP (cont..)

General rule: Use client-side scripting to handle


user interface processing and light processing, such as validation; use server-side scripting for intensive calculations and data storage

Figure 1-17 How a Web server processes a PHP script

30

PHP Programming with MySQL

Introduction to PHP
What is PHP?
PHP stands for "PHP Hypertext Preprocessor An embedded scripting language for HTML like ASP or JSP A language that combines elements of Perl, C, and Java

Introduction to PHP
History of PHP
Created by Rasmus Lerdorf in 1995 for tracking access to his resume Originally a set of Perl scripts known as the Personal Home Page tools Rewritten in C with database functionality Added a forms interpreter and released as PHP/FI: includes Perl-like variables, and HTML embedded syntax

Introduction to PHP
History of PHP (cont.)
Rewritten again in and released as version 2.0 in November of 1997 Estimated user base in 1997 is several thousand users and 50,000 web sites served Rewritten again in late 1997 by Andi Gutmans and Zeev Suraski More functionality added, database support, protocols and APIs

Introduction to PHP
History of PHP (cont.)
User base in 1998 estimated 10,000 users and 100,000 web sites installed Version 3.0 was released in June 1998 as PHP Estimated user base in tens of thousands and hundreds of thousands of web sites served

Introduction to PHP
History of PHP (cont.)
Rewritten again in 1997 by Andi Gutmans and Zeev Suraski More functionality added (OOP features), database support, protocols and APIs PHP 3.0 is released in June 1998 with some OO capability The core is rewritten in 1998 for improved performance of complex applications

Introduction
History of PHP (cont.)
The core is rewritten in 1998 by Zeev and Andi and dubbed the Zend Engine The engine is introduced in mid 1999 and is released with version 4.0 in May of 2000 The estimated user base is hundreds of thousands of developers and several million of web sites served

Introduction
History of PHP (cont.)
Version 5.0 will include version 2.0 of the Zend Engine
New object model is more powerful and intuitive Objects will no longer be passed by value; they now will be passed by reference Increases performance and makes OOP more attractive

PHP Language Basics


The Script Tags
All PHP code is contained in one of several script tags:
<? // Some code ?> <?php // Some code here ?>

PHP Language Basics


The Script Tags (cont.)
<?php // Some code here

?> ASP-style tags


Introduced in 3.0; may be removed in the future <% // Some code here %>

PHP Language Basics


The Script Tags (cont.)
Echo Tags
<table> <tr> <td>Name:</td><td><?= $name ?></td> </tr> <tr> <td>Address:</td><td><?= $address ?></td> </tr> </table>

PHP Language Basics


Hello World!: An Example
Like Perl, there is more than one way to do it
<?php echo Hello World!; ?> <?php $greeting = Hello World! printf(%s, $greeting); ?>

PHP Language Basics


Hello World!: An Example (cont.)
<?php $hello = Hello; $world = World!; print $hello . $world ?>

PHP Language Basics


Constants, Data Types and Variables
Constants define a string or numeric value Constants do not begin with a dollar sign Examples:
define(COMPANY, Acme Enterprises); define(YELLOW, #FFFF00); define(PI, 3.14); define(NL, <br>\n);

PHP Language Basics


Constants, Data Types and Variables
Using a constant
print(Company name: . COMPANY . NL);

PHP Language Basics


Constants, Data Types and Variables
Data types
Integers, doubles and strings
isValid = true; 25 3.14 Four Total value // Boolean // Integer // Double // String // Another string

PHP Language Basics


Constants, Data Types and Variables
Data types
Strings and type conversion
$street = 123; $street = $street . Main Street; $city = Naperville; $state = IL; $address = $street; $address = $address . NL . $city, $state; $number = $address + 1; // $number equals 124

PHP Language Basics


Constants, Data Types and Variables
Data types
Arrays
Perl-like syntax $arr = array("foo" => "bar", 12 => true); same as $arr[foo] = bar; $arr[12] = true;

PHP Language Basics


Constants, Data Types and Variables
Arrays (cont.)
<?php $arr = array("somearray" => array(6 => 5, 13 => 9, "a" => 42));
echo $arr["somearray"][6]; // 5 echo $arr["somearray"][13]; // 9 echo $arr["somearray"]["a"]; // 42 ?>

PHP Language Basics


Constants, Data Types and Variables
Objects
Currently not much more advanced than than associative arrays Using constants Before version 5.0, objects are passed by value Slow Functions can not easily change object variables

PHP Language Basics


Constants, Data Types and Variables
Operators
Contains all of the operators like in C and Perl (even the ternary)

Statements
if, if/elseif Switch/case for, while, and do/while loops Include and require statements for code reuse

Built-in Functions
What comes In the box?
Array Manipulator Functions
sort, merge, push, pop, slice, splice, keys, count

Date and Time Functions


getdate, mkdate, date, gettimeofday, localtime, strtotime, time

Built-in Functions
What comes In the box?
Directory Functions
Platform independent

Error Handling Functions


Recover from warnings and errors

Filesystem Functions
Access flat files Check directory, link, and file status information Copy, delete, and rename files

Built-in Functions
What comes In the box?
IMAP Functions
Manipulate mail boxes via the IMAP protocol

LDAP Functions
Works with most LDAP servers

Mail Functions
mail($recipient, $subject, $message)

Built-in Functions
What comes In the box?
Database Functions
dba: dbm-style abstraction layer dBase Frontbase Informix Ingres II Interbase mSQL

Built-in Functions
What comes In the box?
Database Functions (cont.)
MySQL Oracle PostgreSQL SQL Server

MING
Macromedia Flash

PDF
Create/manipulate PDF files dynamically

Built-in Functions
What comes In the box?
POSIX Functions
Manipulate process information

Regular Expression Functions


Uses POSIX regex

Semaphore and Socket Functions


Available only on Unix

Session Management Functions

Summary
In 1990 and 1991,Tim Berners-Lee created the
World Wide Web at the European Laboratory for Particle Physics (CERN) Transmission Control Protocol/Internet Protocol (TCP/IP) is a large collection of communication protocols used on the Internet A Document Type Definition (DTD) defines the elements and attributes that can be used in a document

57

PHP Programming with MySQL

Summary (cont..)
Cascading Style Sheets (CSS) are a standard
set by the W3C for managing the design and formatting of Web pages in a Web browser A system that consists of a client and a server is known as a two-tier system A three-tier client/server system consists of the client tier, the processing tier, and the data storage tier

58

PHP Programming with MySQL

Summary (cont..)
JavaScript is a client-side scripting language that
allows Web page authors to develop interactive Web pages and sites Hypertext Preprocessor (PHP) is a server-side scripting language that is used for developing interactive Web sites Open source refers to software for which the source code can be freely used and modified

59

PHP Programming with MySQL

Drupal Module Development

ICT Center
We are making IT happen

Integrity

Commitment

Teamwork

You might also like