Internet, intranet and Web
Lecture III Cascading Style Sheets, and Server Side Web Technologies
Marco Solieri marco.solieri@lipn.univ-paris13.fr
Département d’Informatique, Institut Galilée, Université Paris Nord
I nternet , intranet and W eb L ecture III C ascading S tyle S heets - - PowerPoint PPT Presentation
I nternet , intranet and W eb L ecture III C ascading S tyle S heets , and S erver S ide W eb T echnologies Marco Solieri marco.solieri@lipn.univ-paris13.fr Dpartement dInformatique, Institut Galile, Universit Paris Nord November 7 th,
Département d’Informatique, Institut Galilée, Université Paris Nord
1 CSS 3: presentational markup 2 Web server 3 PHP language 4 PHP and HTTP 5 PHP and storage
IWEB: CSS, and Server Side Techs 11/7/2014 2 / 59
CSS 3: presentational markup
IWEB: CSS, and Server Side Techs 11/7/2014 3 / 59
CSS 3: presentational markup History
IWEB: CSS, and Server Side Techs 11/7/2014 3 / 59
CSS 3: presentational markup History
IWEB: CSS, and Server Side Techs 11/7/2014 4 / 59
CSS 3: presentational markup Syntax
property: value
color: green; font-family: Arial; font-size: 12 pt; margin-left: 15 pt;
IWEB: CSS, and Server Side Techs 11/7/2014 5 / 59
CSS 3: presentational markup Syntax
selector , ... { declaration ; ... }
p { font-family: Arial; font-size: 12 pt; } h1, h2, h3 { color: red; margin-left: 15 pt; }
IWEB: CSS, and Server Side Techs 11/7/2014 6 / 59
CSS 3: presentational markup Selectors
IWEB: CSS, and Server Side Techs 11/7/2014 7 / 59
CSS 3: presentational markup Selectors
IWEB: CSS, and Server Side Techs 11/7/2014 8 / 59
CSS 3: presentational markup Selectors
IWEB: CSS, and Server Side Techs 11/7/2014 9 / 59
CSS 3: presentational markup Selectors
IWEB: CSS, and Server Side Techs 11/7/2014 10 / 59
CSS 3: presentational markup Selectors
1 @charset character set encoding, 2 @font-face customized font, automagically downloaded, 3 @import rule inclusion from other stylesheets 4 @media media type targeting: screen, print, projection, aural . . . 5 @namespace definition of xml namespaces 6 @page paged media styling: margins, padding . . . 7 @phonetic-alpabet alphabet to be used when specifying
IWEB: CSS, and Server Side Techs 11/7/2014 11 / 59
CSS 3: presentational markup Properties
IWEB: CSS, and Server Side Techs 11/7/2014 12 / 59
CSS 3: presentational markup Properties
IWEB: CSS, and Server Side Techs 11/7/2014 13 / 59
CSS 3: presentational markup Properties
IWEB: CSS, and Server Side Techs 11/7/2014 14 / 59
CSS 3: presentational markup Style and XHTML
1 declarations inside a <style> attribute in the HTML element, 2 rules inside a <style> element, 3 importing stylesheet from a <style> element, 4 linking stylesheet from a <link> element.
1 type of element, e.g. all the paragraphs; 2 category, e.g. all the paragraphs with some class attribute; 3 element, e.g. the paragraph with some unique id attribute.
IWEB: CSS, and Server Side Techs 11/7/2014 15 / 59
CSS 3: presentational markup Style and XHTML
IWEB: CSS, and Server Side Techs 11/7/2014 16 / 59
CSS 3: presentational markup Style and XHTML
... <style type="text/css"> @import url(/style/external.css) </style> </head> ... <p id="p1"> ...
... <link type="text/css" rel="stylesheet" href="/style/external.css"/> </head> ... <p id="p1"> ...
IWEB: CSS, and Server Side Techs 11/7/2014 17 / 59
CSS 3: presentational markup Cascade
IWEB: CSS, and Server Side Techs 11/7/2014 18 / 59
CSS 3: presentational markup Cascade
p { font-family: Arial; font-size: 12 pt; } p { color: red; font-size: 11 pt; } p { margin-left: 15 pt; color: green;}
IWEB: CSS, and Server Side Techs 11/7/2014 19 / 59
CSS 3: presentational markup Cascade
p { font-family: Arial; font-size: 12 pt; } p { color: red; font-size: 11 pt; } p { margin-left: 15 pt; color: green;}
p { font-family: Arial; font-size: 11 pt; margin-left: 15 pt; color: green; }
IWEB: CSS, and Server Side Techs 11/7/2014 19 / 59
Web server
IWEB: CSS, and Server Side Techs 11/7/2014 20 / 59
Web server
IWEB: CSS, and Server Side Techs 11/7/2014 20 / 59
Web server
IWEB: CSS, and Server Side Techs 11/7/2014 21 / 59
Web server
http://blog.fr/phpblog/index.php?id=20120531-2&t=post&u=antoine
http://blog.fr/antoine/post/2012/05/31/2
IWEB: CSS, and Server Side Techs 11/7/2014 21 / 59
Web server
1 receives a HTTP request 2 sets up environment variables, i.e. the various parts of request 3 spawns the interpreter on the script 4 waits for HTTP reply and forwards it
IWEB: CSS, and Server Side Techs 11/7/2014 22 / 59
Web server
1 receives a HTTP request 2 sets up environment variables, i.e. the various parts of request 3 spawns the interpreter on the script 4 waits for HTTP reply and forwards it
IWEB: CSS, and Server Side Techs 11/7/2014 22 / 59
PHP language
IWEB: CSS, and Server Side Techs 11/7/2014 23 / 59
PHP language Introduction
IWEB: CSS, and Server Side Techs 11/7/2014 23 / 59
PHP language Introduction
IWEB: CSS, and Server Side Techs 11/7/2014 24 / 59
PHP language Scripts and HTML documents
IWEB: CSS, and Server Side Techs 11/7/2014 25 / 59
PHP language Scripts and HTML documents
IWEB: CSS, and Server Side Techs 11/7/2014 26 / 59
PHP language Scripts and HTML documents
IWEB: CSS, and Server Side Techs 11/7/2014 27 / 59
PHP language Base syntax and semantics
<?php $var1 = "foo"; $var2 = $var1; $var3 &= $var1; $var1 = "bar"; echo($var2); echo($var3);?>
IWEB: CSS, and Server Side Techs 11/7/2014 28 / 59
PHP language Base syntax and semantics
<?php $var1 = "foo"; $var2 = $var1; $var3 &= $var1; $var1 = "bar"; echo($var2); echo($var3);?> Prints "foobar"
IWEB: CSS, and Server Side Techs 11/7/2014 28 / 59
PHP language Base syntax and semantics
IWEB: CSS, and Server Side Techs 11/7/2014 29 / 59
PHP language Base syntax and semantics
IWEB: CSS, and Server Side Techs 11/7/2014 30 / 59
PHP language Base syntax and semantics
IWEB: CSS, and Server Side Techs 11/7/2014 31 / 59
PHP language Base syntax and semantics
IWEB: CSS, and Server Side Techs 11/7/2014 32 / 59
PHP language Base syntax and semantics
IWEB: CSS, and Server Side Techs 11/7/2014 33 / 59
PHP language Flow control
IWEB: CSS, and Server Side Techs 11/7/2014 34 / 59
PHP language Flow control
IWEB: CSS, and Server Side Techs 11/7/2014 35 / 59
PHP language Flow control
IWEB: CSS, and Server Side Techs 11/7/2014 36 / 59
PHP language Flow control
<?php while (/* boolean expression */) { /* block */ } ?>
<?php do { /* block */ } while (/* boolean expression */) ?>
IWEB: CSS, and Server Side Techs 11/7/2014 37 / 59
PHP language Flow control
<?php for (/* init */ ; /* test*/ ; /*increment */) { /* block */ } ?>
<?php foreach ($array as $value) { /* block */ } ?> (Break and goto statements available for writing ugly programs.)
IWEB: CSS, and Server Side Techs 11/7/2014 38 / 59
PHP language Modularization and object-orientation
IWEB: CSS, and Server Side Techs 11/7/2014 39 / 59
PHP language Modularization and object-orientation
IWEB: CSS, and Server Side Techs 11/7/2014 40 / 59
PHP language Modularization and object-orientation
<?php class MyClass { function __construct() { echo("Hello world!\n"); } function __destruct() { echo("So soon? Aaargh.\n"); } } echo("new object\n"); $obj = new MyClass(); echo("another object\n"); $obj = new MyClass(); // refer. lost $obj = null //reference in $obj lost again ?>
IWEB: CSS, and Server Side Techs 11/7/2014 41 / 59
PHP language Modularization and object-orientation
<?php interface ifaceName { method($arg1,$arg2); }?>
declaration
IWEB: CSS, and Server Side Techs 11/7/2014 42 / 59
PHP language Modularization and object-orientation
PUBLIC accessible outside the class (default) PRIVATE not accessible outside the class PROTECTED accessible outside, by subclasses only
<?php $var = ClassName::$field; ClassName::method(); ?>
IWEB: CSS, and Server Side Techs 11/7/2014 43 / 59
PHP and HTTP
IWEB: CSS, and Server Side Techs 11/7/2014 44 / 59
PHP and HTTP HTTP request access
Method URI HTTP_version [ Header ]* [ Body ]
IWEB: CSS, and Server Side Techs 11/7/2014 44 / 59
PHP and HTTP HTTP request access
IWEB: CSS, and Server Side Techs 11/7/2014 45 / 59
PHP and HTTP HTTP request access
IWEB: CSS, and Server Side Techs 11/7/2014 46 / 59
PHP and HTTP HTTP trasmission management
IWEB: CSS, and Server Side Techs 11/7/2014 47 / 59
PHP and HTTP HTTP reply management
HEAD the header line (string) REPLACE overwriting flag, default true (boolean) REPLY_CODE the HTTP reply code (int)
IWEB: CSS, and Server Side Techs 11/7/2014 48 / 59
PHP and HTTP HTTP reply management
FILE output: file path of transmission (string reference) LINE output: starting line of transmission (int reference)
IWEB: CSS, and Server Side Techs 11/7/2014 49 / 59
PHP and HTTP HTTP reply management
IWEB: CSS, and Server Side Techs 11/7/2014 50 / 59
PHP and HTTP HTTP state management
setcookie(name[, value[, expire[, path[, domain[, secure]]]]]
NAME identificator (string) VALUE stored value, transparently URLencoded (string) EXPIRE expiration date in seconds (int) PATH path of validity, default ’/’ (string) DOMAIN domain of validity, terminated with ’.’ (string) SECURE need for SSL/TLS underlay? (int)
IWEB: CSS, and Server Side Techs 11/7/2014 51 / 59
PHP and HTTP HTTP state management
IWEB: CSS, and Server Side Techs 11/7/2014 52 / 59
PHP and HTTP HTTP state management
IWEB: CSS, and Server Side Techs 11/7/2014 53 / 59
PHP and storage
IWEB: CSS, and Server Side Techs 11/7/2014 54 / 59
PHP and storage
IWEB: CSS, and Server Side Techs 11/7/2014 54 / 59
PHP and storage MySQL interface
<?php connection mysql_connect( [host[,username[,password]]])?>
<?php mysql_close([connection]); ?>
<?php mysql_list_dbs([connection]) ?>
<?php mysql_select_db(database[, connection]) ?>
IWEB: CSS, and Server Side Techs 11/7/2014 55 / 59
PHP and storage MySQL interface
IWEB: CSS, and Server Side Techs 11/7/2014 56 / 59
PHP and storage MySQL interface
IWEB: CSS, and Server Side Techs 11/7/2014 57 / 59
PHP and storage PDO interface
IWEB: CSS, and Server Side Techs 11/7/2014 58 / 59
PHP and storage PDO interface
IWEB: CSS, and Server Side Techs 11/7/2014 59 / 59