4. About Steve
• Senior Consultant, Crossfire Consulting
– 10+ years helping clients with their information products and
services development efforts.
– Expertise in strategic planning, product development,
marketing, research, computer and communication sciences,
and finance.
– Corporate trainer on HTML5 and other Internet technologies.
– Past lives include new product development at Fujitsu Limited,
co-brand marketing programs at MasterCard, and finance at
American Express.
– Bachelor, master, and doctorate degrees from the Lubin School
of Business at Pace University
– Certified ScrumMaster
5. What people are saying about Steve
"Doctor Steve is intellectual curious on
topics from information technology to
marketing, management, and finance, as
evidenced by his accumulation of
multiple degrees and few real jobs. A
senior consultant highly valued by some
of the world's largest companies, he
remains a vice president at home, where
he is solely responsible trash removal and
dog walking. Steve is intensely interested
in browsers and the 3-D world that's
around the corner.”
7. About James
• Partner, Crossfire Consulting
– 20+ years as an IT consultant, systems engineer,
information security consultant, technology
analyst, and software developer
– Expertise in information security, web application
development, and project and program
management
– Adjunct Professor of ECE&CS at The University of
New Haven and Business&IT at The University of
Phoenix
– Previous experiences at Verizon and Pitney Bowes
– Bachelor, master, and Ph.D. degrees from Tufts
University, School of Engineering
– Certified Information Systems & Security
Professional
– Certified CT High School Math Teacher
– Opened for James Brown in 1981
– Next real gig, “Sweet Charity,” March 8-10
10. XAMPP
• An Apache Web Server, MySQL, PHP, and Perl
web application development environment for
your personal use
• http://www.apachefriends.org
– Download the package for your Operating System
– Install XAMPP (.exe for Windows, .dmg for Mac)
• Take all defaults!
Slide 10
11. Start XAMPP
• Mac: Double click
/Applications/XAMPP/XAMPP Control
• Windows: Launch XAMPP from Start |
Programs | XAMPP
• The Control Application is used to start/stop,
install/uninstall services.
Slide 11
12. How to start the XAMPP control panel
Select the XAMPP Control Panel item from the Windows Start
menu or double-click on the XAMPP icon on your desktop.
How to start and stop Apache or MySQL
Click on its Start or Stop button.
To start Apache or MySQL automatically when your computer
starts, check its Svc checkbox.
Slide 12
13. The XAMPP Control Panel
Start the Apache
Web server and
MySQL server.
Do not run as
service yet!
Slide 13
14. Explore XAMPP
• Go to: http://localhost
• What do you see?
– Should see “Welcome to XAMPP for ‘your operating system’!”
• What is really happening?
– XAMPP has set up a “real” web environment on your machine!
– Apache running locally (not on another server) and on port 80
– MySQL running locally and on port 3306
• PHP and Perl do not have ports (not servers)
• Potential problems
– You do not have administrative privileges for your laptop
– Already have a web server running on port 80 or MySQL on your
laptop
– Other wacky permissions issues (typically corporate types)
Slide 14
15. Get familiar with the XAMPP install
• Nose around, see what you see!
• Notables
– phpinfo()
– phpMyAdmin
• Under the covers
– The XAMPP default “htdocs” folder
• The only thing we will modify!
– Really, do NOT change anything else!
• Maybe /etc/http.conf, but even then resist!
Slide 15
16. Get ready for our exercises!
• Download the PHP & MySQL exercises
– http://murach.com/downloads/phps.htm
– Choose the .zip file (phps_allfiles.zip)
• Inflate the .zip file (phps_allfiles folder)
• Move the three folders in the phps_allfiles
folder to the XAMPP /htdocs folder
Slide 16
17. The structure for the book apps and ex_starts
xampp
htdocs
book_apps
ch01_product_discount
ch02_product_discount
ch02_future_value
ch04_product_list
ch04_product_manager
...
ex_starts
ch02_ex1
ch02_ex2
ch04_ex1
...
Slide 17
18. How to deploy a PHP application on a local server
Copy all of the directories and files for an application to the
xampphtdocs directory on the server.
How to deploy the downloadable applications
on a local server
Copy the book_apps and ex_starts directories and all their
contents to the xampphtdocs directory on the server.
How to deploy an application
on an Internet server
Use an FTP (File Transfer Protocol) program to upload the tested
directories and files to the htdocs directory of the Apache web
server.
Slide 18
19. The components of an HTTP URL
http://www.murach.com/books/lists.htm
protocol domain name path filename
What happens if you omit parts of a URL
If you omit the protocol, the default of http:// will be used.
If you omit the filename, one of the default filenames for the
Apache web server will be used: index.htm, index.html, or
index.php.
If you omit the filename and there is no default file, Apache will
display an index of the files and directories in the path.
Slide 19
20. URLs for pages on an Internet web server
A request for a specific page
http://www.murach.com/books/xhcss.htm
A request for the default (home) page of a web site
http://www.murach.com/
URLs for applications on a local web server
A request for the default page in an application directory
http://localhost/book_apps/ch01_product_discount/
A request for a directory with no default page
http://localhost/book_apps/
Slide 20
21. An index of the apps in the book_apps directory
Slide 21
23. How to open files in Notepad++
Use the Open button in the toolbar.
Right-click on the file in the Windows Explorer and select Edit
with Notepad++.
How to save the current file
Use the Save button in the toolbar.
Press Ctrl+S.
How to save all open files
Use the Save All button.
Slide 23
24. How to close the current file in Notepad++
Use the Close button in the toolbar.
How to close all open files
Use the Close All button.
How to open a new file in a new tab
Use the New button in the toolbar.
Slide 24
25. How to change the Notepad++ style for comments
Start the SettingsStyler Configurator command.
Select PHP in the language list and COMMENT in the style list.
Change the font name and font size in the drop-down lists to the
blank entries at the top of the lists.
Repeat this for COMMENTLINE for the PHP language, for
COMMENT for the HTML language, and for COMMENT for the
CSS language.
Slide 25
27. Cloud Computing, Web Mobility & the HTML5 suite
Few Continuous Some Access Many Connected
Cloud Sources Networks Devices Unlimited # of Apps
Enterprise Apps
(PC targeted at)
cellular
Custom Apps
(device
targeted)
telco / Browser Apps
cable (targeted at all
devices)
Html5
CSS3
WiFi ISPs JavaScript
Web GL
Mwave
SVG
satellite
Globally available & accessible; Easy & natural for the user;
massively scalable; and fully mass customized & micro-
reliable & secure services targeted by the enterprise
28. Objectives
1. Provide you with an understanding key Web
technologies
2. Provide you with an understanding of graphic
design, usability and SEO
3. Enable you to design and code a web app
29. Web Technology Stack
Data – What does it know?
Behavior – What does it do?
Behavior – What does it do?
Presentation – What does it look like?
Structure – What does this logically mean?
Richness
of the
Experience
30. Your final project
• You will build the
greatest guitar store
app, a fully functional
e-commerce site
• You will then customize
the user interface and
show it off to the class
32. Internet ≠ World Wide Web
The World Wide Web is a system of interlinked hypertext
documents accessed via the Internet.
The World Wide Web uses
3 essential technologies:
• Uniform Resource Locator
• HyperText Transfer Protocol
• HyperText Markup Language
34. Uniform Resource Locator
First, a review…
• A web page is an object that consists of base HTML-file and
my include several referenced objects
– A referenced object can be a file, an image, an applet, audio file,…
• Each object is addressable by a URL
http://www.someschool.edu:80/someDept/pic.gif
Protocol Host Port Path
Scheme Name Name
36. HTTP Request
carriage return character
line-feed character
request line
(GET, POST, GET /index.html HTTP/1.1rn
HEAD commands) Host: www-net.cs.umass.edurn
User-Agent: Firefox/3.6.10rn
Accept: text/html,application/xhtml+xmlrn
header Accept-Language: en-us,en;q=0.5rn
lines Accept-Encoding: gzip,deflatern
Accept-Charset: ISO-8859-1,utf-8;q=0.7rn
carriage return, Keep-Alive: 115rn
line feed at start Connection: keep-alivern
rn
of line indicates
end of header lines
37. HTTP Methods
• GET is used to obtain a resource
• POST is used to used to send data to be processed
– input is uploaded to server in entity body
• HEAD is used to obtain the response headers only, and not the a
resource's contents
– asks server to leave requested object out of response
• PUT uploads file in entity body to path specified in URL field
• DELETE deletes file specified in the URL field
38. HTTP Response
status line
(protocol
status code HTTP/1.1 200 OKrn
status phrase) Date: Sun, 26 Sep 2010 20:09:20 GMTrn
Server: Apache/2.0.52 (CentOS)rn
Last-Modified: Tue, 30 Oct 2007 17:00:02
GMTrn
header ETag: "17dc6-a5c-bf716880"rn
Accept-Ranges: bytesrn
lines Content-Length: 2652rn
Keep-Alive: timeout=10, max=100rn
Connection: Keep-Alivern
Content-Type: text/html; charset=ISO-8859-
1rn
rn
data, e.g., <html>
data data data data data ...
requested
HTML file
Application 2-38
39. HTTP Response codes
200 OK
– request succeeded, requested object later in this msg
301 Moved Permanently
– requested object moved, new location specified later in this msg
(Location:)
400 Bad Request
– request msg not understood by server
404 Not Found
– requested document not found on this server
505 HTTP Version Not Supported
Application 2-39
40. Suppose a user enters
(contains text,
www.someSchool.edu/someDepartment/home.index references to 10
jpeg images)
1a. HTTP client initiates TCP
connection to HTTP server
1b. HTTP server at host
(process) at
www.someSchool.edu waiting
www.someSchool.edu on port 80
for TCP connection at port 80.
“accepts” connection, notifying
client
2. HTTP client sends HTTP request
message (containing URL) into TCP
connection socket. Message 3. HTTP server receives request
indicates that client wants object message, forms response message
someDepartment/home.index containing requested object, and
sends message into its socket
time
Application 2-40
41. Nonpersistent HTTP (cont.)
4. HTTP server closes TCP connection.
5. HTTP client receives response
message containing html file,
displays html. Parsing html
file, finds 10 referenced jpeg
objects
time 6. Steps 1-5 repeated for each of 10
jpeg objects
Key takeaway is that the Web server maintains no information about
past client requests
43. The Birth of
HyperText Markup Language
• HyperText denotes a network of
linked reference information
• Invented HyperText Markup
Language in 1990
– Not a programming language but a
HyperText authoring tool
44. Theoretical categories of a
electronic Markup Languages
• Presentational markup defines the look of each text element
in order to achieve WYSIWYG (e.g. MS Word)
• Procedural markup provide specific presentational
instructions to the program that is processing the text (e.g.
PostScript)
• Semantic Markup (Descriptive/Declarative Markup) describes
the logical structure of the document, leaving the
interpretation of how to present to the document to the
program that is processing the text
47. The Early History of HTML
Source: University of Maryland, Baltimore County
48. Why we a new HTML standard
“HTML isn't a very good
language for making Web
pages. However, it has been a
very good language for
making the Web.”
—Edd Dumbill
Dec 6, 2005
49. Deficiencies of
HTML4/XHMTL1
Need for
• Less presentation elements
• More semantic elements
• More separation of structure and presentation
• More robust media controls
51. XHMTL 2
World Wide Web Consortium
published initial draft in 2002,
representing the first major change
since 1999 (HTML 4.01)
• Seeks to replace HTML
• Relies solely on XML syntax
• Completes the separation of
content and presentation
• Introduces new functional
elements, reducing the use of
JavaScript
52. HMTL 5
Web Hypertext Application Technology
Working Group, founded by Apple,
Mozilla, and Opera in 2004, published
HMTL 5 (aka Web Applications 1)
• Seeks to extend HTML
• Maintains SGML syntax
• Supports both HMTL4 and XHTML1
• Adopts de facto industry standards
• Adds new functional elements
• Adds new JavaScript-based APIs
53. The new way forward
Continuous Periodic
updates Releases
54. Why did HTML5 win out?
XHTML2 disadvantages HTML5 advantages
• Required major changes by • Ensured backward
Browsers compatible
• New language requiring • Standardized accepted
unlearning, learning, and techniques and industry
relearning practices
• Insufficient new features • Changes aimed to solve real
• It wasn't backwards problems
compatible with the Web
• It didn't solve real problems
55. What does HTML5 mean to Web
designers?
New tags for
• semantic layout
• support of rich media
• new functionality
• new APIs
61. <!DOCTYPE>
• HTML 4 document type definition:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
• HTML 5 document type definition:
<!DOCTYPE html>
62. Looser Rules for Markup
•
• <html>, <head>, requires are all optional
<body> type
<link> no longer not required attribute
•
• Closing tags are
No distinction betweencase letters lower case matter</EM></p>
• <P>Upper and lower upperon <Em> don’t
and
Valid <p>this closing slash (/)/> self-closing (aka void element)
to omit is valid</p><br
<p>and this is valid</p><br>
<p>even this is valid</p><br/>
•
• Attributes are not required need to be encased in quotes it
Attribute values no longer to have values associated with
<input type=checkbox checked>
63. Best Practice for New Rules
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel=“stylesheet” type="text/css” href=”styles.css” media="screen” />
<script src=“scripts.js” type="text/javascript"><scripts>
</head>
<body>
…
</body>
</html>
69. HTML Document Basics
<html> = (optional) root element identifies that the document
contains HTML
<head> = (optional) element for “invisible” information about
the document and presentation and behavior rules
<body> = (optional) element
for “visible” content that gets
displayed within the viewport
82. HTML Core Attributes
• ID
• Class
• Title
– You can add extra information about an element
<abbr title="World Health
Organization">WHO</abbr>
83. More on Classes and IDs
A tag can contain both a class and an ID:
<p id=“thoughts” class=“group”> … </p>
CSS works with both classes and IDs
JavaScript works only with IDs
93. Block versus Inline
BLOCK INLINE
Space: Take up the full width Space: takes up only as much
available, with a new lines width as it needs and does not
before and after force new lines
Nesting: Can have inline or Nesting: Can only have other
other block elements nested inline elements nested inside
inside
94. More on Text Tags
Logical Presentational
<h1>
<h2>
Block <h3>
<p>
<em>
<i>
<strong>
<b>
<br />
<code>
Inline <sub>
<sup>
<big>
<small>
95. Pop Quiz:
Which would you use and why?
Logical Presentational
Bold <strong> <b>
Italics <em> <i>
98. Exercise #1
Create a page titled My Discover
Add these paragraphs
There are real uses for superscript and subscript (although deleted text is less
common).
Superscript works for fancy numbers: 1st
Subscript is handy for chemistry: H20
Italic print: this page assumes no liability for damages incurred by using or not
using these elements.
Hinweis der Redaktion
Separation of presentation and structure (CSS and HTML);Separation of behavior and structure (JavaScript and HTML);Separation of behavior and presentation (JavaScript and CSS)
HTTP uses the client-server model: A Web Browser (HTTP client) opens a connection and sends a request message to an Apache Web (HTTP) server; A Web Serverreturns a response message, which usually containing the resource that was requested. After delivering the response, the server closes the connection (making HTTP a stateless protocol, i.e. not maintaining any connection information between transactions).