SlideShare une entreprise Scribd logo
1  sur  24
Télécharger pour lire hors ligne
SPERIMENTAZIONI DI TECNOLOGIE
E COMUNICAZIONI MULTIMEDIALI
salvatore.iaconesi@artisopensource.net
Scripting languages

PHP
Inside the HTML page




                       <?php

                            ... PHP code ...

                       ?>
EXECUTED ON THE SERVER
BEFORE GIVING BACK THE PAGE TO THE USER

USED TO DYNAMICALLY PRODUCE
THE CONTENT OF THE WEB PAGE

WE WILL USE THEM TO INTEGRATE INFORMATION
COMING FROM A DATABASE OR FROM A
CONTENT MANAGEMENT SYSTEM (CMS) INTO
WEB AND MOBILE-WEB CONTENT
THE IDEA OF THE TEMPLATE




IN A “NORMAL” HTML DOCUMENT:

                 <H1>WELCOME Mario!</H1>



IN A TEMPLATE:

                 <H1>WELCOME <?php echo( $user_name); ?></H1>
<?php echo( $user_name ); ?>



    IT MEANS THAT THIS PHP INSTRUCTION WILL BE
    EXECUTED ON THE SERVER BEFORE DELIVERING
    THE HTML PAGE TO THE USER

    $user_name is a variable that will contain an information
    (and in a bit we will see how it is possible to provide it)

    The welcome greeting will thus be composed by a
    fixed part and by a dynamic one (maybe the name of
    the user comes from the database?)
CMS




BROWSER




          WEB SERVER       PHP       DATABASE
                       INTERPRETER
The user asks to see a certain web page (using the browser)

The request goes to the web server, that forwards it to the CMS

The CMS interprets the request as the need to aggregate a series of
resources (texts, images, videos, sounds, information, animations...) in
order to produce the content that was requested by the server, and
selects a template that is fit to composing these resources together.

The CMS uses a PHP program (or any other scripting language) to compose
the resources into the template

Templates are regular HTML documents but in some parts of them
Information is replaced by placeholders, by PHP instructions, by loops
and by conditions.
PLACEHOLDER




  A placeholder will be replaced by relevant information.

  For example in the Wordpress CMS there are various types of
  placeholders. One of them are shortcodes

  Inserting the shortcode

  [gallery]

  means that it will be automatically replaced in the HTML by a
  browsable gallery of all the images contained in the content that
  the user has requested.

  Pretty powerful, isn't it?
PHP INSTRUCTIONS




 They will be executed to produce the content of the page.

 For example, in an e-commerce site you might have a shopping
 cart used by the user to buy some products.

 In the Template you will have variables that contain the
 unit price (for example $unit_price) and the quantity ($quantity) of a certain
 product that the user wishes to buy.

 You could use PHP instructions to show the total cost to the user:

 <h3>Your total price is: <?php echo( $unit_price * $quantity ); ?></h3>




   The echo command outputs information to the HTML document.
   The * means multiply
LOOPS

 Many informations have the same structure. You can use loops to
 repeat the same task multiple times.

 For example you could print out all the information of the articles on a certain
 page by making a loop:

 <?php
     for($i = 0; $i < 10 ; $i++){
          ?>
               <div id=”article<?php echo($i) ?>” class=”article-box”>
                     <p><?php echo( $articles[ $i ] ); </p>
               </div>
          <?php
     }
 ?>


 The $artices variable is an array. Arrays contain more than one value. You access them by using square brackets.
 The first value is [0], the second is [1] and so on. You know how many values an array contains by using the
 count instruction. The array $articles will contain values for $articles[0], $articles[1] and up to (but not including)
 the number shown by count($articles), meaning $articles[ count( $articles) – 1 ]
 In the loop, $i++ means “add 1 to $i” and it is the same as writing $i = $i + 1;
The FOR LOOP

 The FOR loop seen in the previous slide has a very useful structure:


 for ( initialization ; condition ; increment ){

     ... instructions to be repeated ...

 }

 INITIALIZATION gets executed only once at the beginning of the loop, and it
 describes where we want to start from (let's say that if we want to count from
 0 to 10, we will start at 0 --> $i = 0; in the previous example)

 CONDITION tells us when we need to stop: whenever the condition is verified
 the loop goes on with another cycle. In the previous example $i<10

 INCREMENT tells us how to proceed, go ahead, in the loop. The increment
 is executed after each cycle of the loop, and then the condition is checked,
 to see if there will be another cycle or if the loop has finished looping. In the
 previous example, increment is $i++ to move forward with our count.
CONDITIONS

 Conditions help you create flexible templates that assume different forms
 according to different scenarios.
 For example we could use this condition in our template:

 <?php
     if($age<18){
          echo( “you are under-age!” );
     } else if ($age<90){
          echo( “Ok, this content is perfect for you!” );
     } else {
          echo(“You're too old for this!”);
     }
 ?>


 The IF statement is very powerful it can combine multiple IF, IF ELSE, IF ELSE IF ELSE statements and
 by reading it in plain english it is pretty obvious in what it does. It verifies conditions, one by one (or
 just one, if there is only a plain IF statement with no ELSE IF or ELSE statements to follow) and as soon as it
 verifies that one is TRUE (like in 3 < 10 ) it executes the code found in the curly brackets {} right after it.
 In PHP curly brackets mark blocks of code: these can be used to specify code that should be executed together.
 Blocks of code can be nested one into each other.
GETTING VALUES INTO PHP


   We can get the values that are used in PHP in several ways:

   ● Get them from another page, using the GET and POST methods
     ● For example by creating a form

   ● Get them from a database (next lessons)

   ● Synthesize them (by creating them according to some process)




   The MOST fundamental is the use of GET and POST mechanisms
   to propagate information from one page to the other.
GET
As you might have seen, internet addresses are often in a form like this:

http://www.aninternetdomain.com/index.php?name1=value1&name2=value2

This internet address is passing values to the “index.php” web page:

name1=value1
name2=value2

This method of passing values is called GET and is easily accessible from PHP.
For this we can use the $_GET predefined variable (meaning that the system
creates it for us):

$my_varable = $_GET[“name1”];

In the example, $my_variable will, thus, contain the value “value1”

GET is very easy to use, but it has one major limitation: the string of characters
after the “?” in the internet address must not be longer than 1024 characters,
or it will be cut off. So GET is perfect for every case in which you must not send
too much data, and when data can be represented as a string (not to send an
image, for example).
POST
POST method of sending information bypasses the problems of the GET method
(content can be as long as you want, and can transfer binary content) but
it cannot be easily experimented: to try it out we must create a FORM (next slide)

We access POST sent information in much the same way as GET: the system
automatically provides us with the $_POST variable that can be used to access
information sent through POST methods:

$my_variable = $_POST[“name-of-a-very-long-information”];
FORMS

  Forms are HTML elements used to send information to another page:


  <FORM ACTION=”...” METHOD=”...” >

      <!-- a series of input fields -->

      <!-- ... and then a SUBMIT button to send the info -->
      <INPUT TYPE=”SUBMIT” VALUE=”SEND” />

  </FORM>

  The ACTION parameter specifies who is the information is to be sent to
  (ex.: if we want to send the info to the “store.php” web page, we will
  write its name into the ACTION parameter)

  The METHOD parameter allows us to choose among GET/POST
  methods of sending info to a web page.
FORMS example - first step

   In one page (let's call it “a.php”) I could have this form:


   <form method=”POST” action=”b.php”>

       What is your name?<br />
       <input type=”text” name=”user_name” />
       <br />
       <br />
       <input type=”SUMBIT” value=”SEND” />

   </form>
FORMS example - second step

       In the other page (let's call it “b.php”) I could have this PHP code:


       <?php

              $user_name = “unknown user”;
              If( isset( $_POST[“user_name”] ){
                    $user_name = $_POST[“user_name”];
              }

              echo( “Welcome to this webpage ” . $user_name . “ !” );
       ?>



The isset() command verifies that a certain variable actually exists. For example here we use it to verify that someone is
actually sending something from the other page. If this is not the case, the default value we setup at the beginning will
be used instead.

Strings are joined using a dot. In the echo command, we use the dot “.” symbol to attach the predefined parts of the
welcome message to the variable.
EXERCISE 1
Write two web pages:
-   the first one, called “a.php” contains a form, asking for the user's name, and a submit
    button. The FORM goes to page “b.php”
-   the second one, called “b.php” takes the input from the first one and prints it out
    20 times




EXERCISE 2
Write two web pages:
-   the first one, called “a.php” contains a form, asking for the user's name, a number,
    and a submit button. The FORM goes to page “b.php”
-   the second one, called “b.php” takes the input from the first one and prints out
    the user name a number of times that is equal to the one specified by the user
    in the second input field. (if the user writes “Mario” and “10”, the name “Mario” will
    be printed out 10 times)
EXERCISE 3
Write two web pages:
-   the first one, called “a.php” contains a form, asking for the user's name, a text using a
    TEXTAREA input component, and a submit button. The FORM goes to page “b.php”
-   the second one, called “b.php” takes the input from the first one and prints it out using
    the user name for a welcome message and printing out the text the user wrote in
    the TEXTAREA really big, by adding it to a DIV element in the b.php page whose
    class attribute points out to a CSS rule with an enormous font.


EXERCISE 4
Write two web pages:
-   the first one, called “a.php” contains a form, asking for the user's name, a select box
    with a couple of options (you choose them),
    and a submit button. The FORM goes to page “b.php”
-   the second one, called “b.php” takes the input from the first one and prints out
    the user name and, depending on which selection the user made in the select box,
    print out a custom message (ex.: if the coices were “chocolate” and “vanilla” the
    messages printed out could be, respectively, “Perfect! Your chocolate ice cream
    Is coming up!” and “Oh, sorry: We're out of vanilla...”)
EXERCISE 5
Write two web pages:
-   the first one, called “a.php” contains a form, asking for
    -    an “article-type”, through a drop-down menu (select) with values 1,2 and 3
    -    an article-title
    -    an article-text
    -    and a submit button to send the info

-   the second one, called “b.php”:
    -    takes the “article-type” parameter and creates a <div> with a different class
         according to it ( article-type==1 --> class=”article-type-1” and so on)
    -    composes the rest of the article using article-title and article-text
    -    try using CSS rules so that the three article types correspond to radically
         different renderings on the web page
RESOURCES


  XAMPP
     To use PHP on your computer you need to install it and a web server.
     Download and install XAMPP at:
     -   http://www.apachefriends.org/it/xampp.html

  PHP TUTORIALS
     -   http://www.php.net
     -   http://php.net/manual/en/tutorial.php
     -   http://www.w3schools.com/PHP/
     -   http://www.homeandlearn.co.uk/php/php.html

  FORM TUTORIALS
     -  http://www.w3schools.com/html/html_forms.asp
     -  http://www.htmlgoodies.com/tutorials/forms
     -  http://www.phpf1.com/tutorial/php-form.html
NEXT STEPS




In the next lesson we will use PHP to build our first Wordpress theme.

It is really important that you follow the proposed tutorials and try out the examples.


See you next time :)

Contenu connexe

Tendances

Tendances (19)

Php mysql
Php mysqlPhp mysql
Php mysql
 
Open Source Package PHP & MySQL
Open Source Package PHP & MySQLOpen Source Package PHP & MySQL
Open Source Package PHP & MySQL
 
Web Design EJ3
Web Design EJ3Web Design EJ3
Web Design EJ3
 
Overview of PHP and MYSQL
Overview of PHP and MYSQLOverview of PHP and MYSQL
Overview of PHP and MYSQL
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
Programming with php
Programming with phpProgramming with php
Programming with php
 
Php and MySQL
Php and MySQLPhp and MySQL
Php and MySQL
 
PHP Web Programming
PHP Web ProgrammingPHP Web Programming
PHP Web Programming
 
PHP NOTES FOR BEGGINERS
PHP NOTES FOR BEGGINERSPHP NOTES FOR BEGGINERS
PHP NOTES FOR BEGGINERS
 
Php-mysql by Jogeswar Sir
Php-mysql by Jogeswar SirPhp-mysql by Jogeswar Sir
Php-mysql by Jogeswar Sir
 
Login and Registration form using oop in php
Login and Registration form using oop in phpLogin and Registration form using oop in php
Login and Registration form using oop in php
 
Basic php 5
Basic php 5Basic php 5
Basic php 5
 
Php Unit 1
Php Unit 1Php Unit 1
Php Unit 1
 
Intro to PHP
Intro to PHPIntro to PHP
Intro to PHP
 
Web 8 | Introduction to PHP
Web 8 | Introduction to PHPWeb 8 | Introduction to PHP
Web 8 | Introduction to PHP
 
PHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginnersPHP complete reference with database concepts for beginners
PHP complete reference with database concepts for beginners
 
Intro to php
Intro to phpIntro to php
Intro to php
 
Form Processing In Php
Form Processing In PhpForm Processing In Php
Form Processing In Php
 
Php Tutorial | Introduction Demo | Basics
 Php Tutorial | Introduction Demo | Basics Php Tutorial | Introduction Demo | Basics
Php Tutorial | Introduction Demo | Basics
 

En vedette

FakePress presents: Cities tell their stories and "a Fake Project"
FakePress presents: Cities tell their stories and "a Fake Project"FakePress presents: Cities tell their stories and "a Fake Project"
FakePress presents: Cities tell their stories and "a Fake Project"Salvatore Iaconesi
 
Fake Press, Ubiquitous Anthropology
Fake Press, Ubiquitous AnthropologyFake Press, Ubiquitous Anthropology
Fake Press, Ubiquitous AnthropologySalvatore Iaconesi
 
Sensible Data, a presentation for Visualizing Europe
Sensible Data, a presentation for Visualizing EuropeSensible Data, a presentation for Visualizing Europe
Sensible Data, a presentation for Visualizing EuropeSalvatore Iaconesi
 
Emergent Communities and Open Source Cure
Emergent Communities and Open Source CureEmergent Communities and Open Source Cure
Emergent Communities and Open Source CureSalvatore Iaconesi
 
Human Ecosystems - the relational ecosystems of cities for a new definition o...
Human Ecosystems - the relational ecosystems of cities for a new definition o...Human Ecosystems - the relational ecosystems of cities for a new definition o...
Human Ecosystems - the relational ecosystems of cities for a new definition o...Salvatore Iaconesi
 
Master Exhibit & Public Design, La Sapienza, Lezione 1
Master Exhibit & Public Design, La Sapienza, Lezione 1Master Exhibit & Public Design, La Sapienza, Lezione 1
Master Exhibit & Public Design, La Sapienza, Lezione 1Salvatore Iaconesi
 

En vedette (6)

FakePress presents: Cities tell their stories and "a Fake Project"
FakePress presents: Cities tell their stories and "a Fake Project"FakePress presents: Cities tell their stories and "a Fake Project"
FakePress presents: Cities tell their stories and "a Fake Project"
 
Fake Press, Ubiquitous Anthropology
Fake Press, Ubiquitous AnthropologyFake Press, Ubiquitous Anthropology
Fake Press, Ubiquitous Anthropology
 
Sensible Data, a presentation for Visualizing Europe
Sensible Data, a presentation for Visualizing EuropeSensible Data, a presentation for Visualizing Europe
Sensible Data, a presentation for Visualizing Europe
 
Emergent Communities and Open Source Cure
Emergent Communities and Open Source CureEmergent Communities and Open Source Cure
Emergent Communities and Open Source Cure
 
Human Ecosystems - the relational ecosystems of cities for a new definition o...
Human Ecosystems - the relational ecosystems of cities for a new definition o...Human Ecosystems - the relational ecosystems of cities for a new definition o...
Human Ecosystems - the relational ecosystems of cities for a new definition o...
 
Master Exhibit & Public Design, La Sapienza, Lezione 1
Master Exhibit & Public Design, La Sapienza, Lezione 1Master Exhibit & Public Design, La Sapienza, Lezione 1
Master Exhibit & Public Design, La Sapienza, Lezione 1
 

Similaire à Sperimentazioni di Tecnologie e Comunicazioni Multimediali: Lezione 5

php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3tutorialsruby
 
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/tutorialsruby
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3tutorialsruby
 
FYBSC IT Web Programming Unit IV PHP and MySQL
FYBSC IT Web Programming Unit IV  PHP and MySQLFYBSC IT Web Programming Unit IV  PHP and MySQL
FYBSC IT Web Programming Unit IV PHP and MySQLArti Parab Academics
 
Php by shivitomer
Php by shivitomerPhp by shivitomer
Php by shivitomerShivi Tomer
 
Php forms and validations by naveen kumar veligeti
Php forms and validations by naveen kumar veligetiPhp forms and validations by naveen kumar veligeti
Php forms and validations by naveen kumar veligetiNaveen Kumar Veligeti
 
Web Development Course: PHP lecture 2
Web Development Course: PHP lecture 2Web Development Course: PHP lecture 2
Web Development Course: PHP lecture 2Gheyath M. Othman
 
Php interview questions
Php interview questionsPhp interview questions
Php interview questionssekar c
 
Introduction To Php For Wit2009
Introduction To Php For Wit2009Introduction To Php For Wit2009
Introduction To Php For Wit2009cwarren
 
Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPwahidullah mudaser
 
Php a dynamic web scripting language
Php   a dynamic web scripting languagePhp   a dynamic web scripting language
Php a dynamic web scripting languageElmer Concepcion Jr.
 
Php interview-questions and answers
Php interview-questions and answersPhp interview-questions and answers
Php interview-questions and answerssheibansari
 
Working with data.pptx
Working with data.pptxWorking with data.pptx
Working with data.pptxSherinRappai
 
10_introduction_php.ppt
10_introduction_php.ppt10_introduction_php.ppt
10_introduction_php.pptGiyaShefin
 

Similaire à Sperimentazioni di Tecnologie e Comunicazioni Multimediali: Lezione 5 (20)

php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3
 
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3
 
FYBSC IT Web Programming Unit IV PHP and MySQL
FYBSC IT Web Programming Unit IV  PHP and MySQLFYBSC IT Web Programming Unit IV  PHP and MySQL
FYBSC IT Web Programming Unit IV PHP and MySQL
 
forms.pptx
forms.pptxforms.pptx
forms.pptx
 
Introduction to php
Introduction to phpIntroduction to php
Introduction to php
 
Php
PhpPhp
Php
 
Php by shivitomer
Php by shivitomerPhp by shivitomer
Php by shivitomer
 
Php forms and validations by naveen kumar veligeti
Php forms and validations by naveen kumar veligetiPhp forms and validations by naveen kumar veligeti
Php forms and validations by naveen kumar veligeti
 
PHP-Part4
PHP-Part4PHP-Part4
PHP-Part4
 
Web Development Course: PHP lecture 2
Web Development Course: PHP lecture 2Web Development Course: PHP lecture 2
Web Development Course: PHP lecture 2
 
Php session
Php sessionPhp session
Php session
 
Php interview questions
Php interview questionsPhp interview questions
Php interview questions
 
Introduction To Php For Wit2009
Introduction To Php For Wit2009Introduction To Php For Wit2009
Introduction To Php For Wit2009
 
Php
PhpPhp
Php
 
Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHP
 
Php a dynamic web scripting language
Php   a dynamic web scripting languagePhp   a dynamic web scripting language
Php a dynamic web scripting language
 
Php interview-questions and answers
Php interview-questions and answersPhp interview-questions and answers
Php interview-questions and answers
 
Working with data.pptx
Working with data.pptxWorking with data.pptx
Working with data.pptx
 
10_introduction_php.ppt
10_introduction_php.ppt10_introduction_php.ppt
10_introduction_php.ppt
 

Plus de Salvatore Iaconesi

Innovation and Trangression: exploring Third Spaces and Excess Spaces
Innovation and Trangression: exploring Third Spaces and Excess SpacesInnovation and Trangression: exploring Third Spaces and Excess Spaces
Innovation and Trangression: exploring Third Spaces and Excess SpacesSalvatore Iaconesi
 
Third Infoscape, presented at DIS2017 in Edinburgh
Third Infoscape, presented at DIS2017 in EdinburghThird Infoscape, presented at DIS2017 in Edinburgh
Third Infoscape, presented at DIS2017 in EdinburghSalvatore Iaconesi
 
La Cura: Erbe Indisciplinate, ricapitolazione
La Cura: Erbe Indisciplinate, ricapitolazioneLa Cura: Erbe Indisciplinate, ricapitolazione
La Cura: Erbe Indisciplinate, ricapitolazioneSalvatore Iaconesi
 
La Cura, Erbe Indisciplinate, presentazione di benvenuto, frame
La Cura, Erbe Indisciplinate, presentazione di benvenuto, frameLa Cura, Erbe Indisciplinate, presentazione di benvenuto, frame
La Cura, Erbe Indisciplinate, presentazione di benvenuto, frameSalvatore Iaconesi
 
Human Ecosystems and the Ubiquitous Commons at the STARTS program meeting
Human Ecosystems and the Ubiquitous Commons at the STARTS program meetingHuman Ecosystems and the Ubiquitous Commons at the STARTS program meeting
Human Ecosystems and the Ubiquitous Commons at the STARTS program meetingSalvatore Iaconesi
 
Ubiquitous Commons at NetFutures 2015
Ubiquitous Commons at NetFutures 2015Ubiquitous Commons at NetFutures 2015
Ubiquitous Commons at NetFutures 2015Salvatore Iaconesi
 
Near Future Design class at Isia Design: Transmedia narratives
Near Future Design class at Isia Design: Transmedia narratives Near Future Design class at Isia Design: Transmedia narratives
Near Future Design class at Isia Design: Transmedia narratives Salvatore Iaconesi
 
Ubiquitous Commons workshop at transmediale 2015, Capture All
Ubiquitous Commons workshop at transmediale 2015, Capture AllUbiquitous Commons workshop at transmediale 2015, Capture All
Ubiquitous Commons workshop at transmediale 2015, Capture AllSalvatore Iaconesi
 
Informazione Ubiqua: come è fatto un museo ubiquo?
Informazione Ubiqua: come è fatto un museo ubiquo?Informazione Ubiqua: come è fatto un museo ubiquo?
Informazione Ubiqua: come è fatto un museo ubiquo?Salvatore Iaconesi
 
Art is Open Source at Visualize: materials and links
Art is Open Source at Visualize: materials and linksArt is Open Source at Visualize: materials and links
Art is Open Source at Visualize: materials and linksSalvatore Iaconesi
 
Near Future Design: the performance of infinite futures
Near Future Design: the performance of infinite futuresNear Future Design: the performance of infinite futures
Near Future Design: the performance of infinite futuresSalvatore Iaconesi
 
Incautious Porn, SSN2014 Presentation in Barcelona
Incautious Porn, SSN2014 Presentation in BarcelonaIncautious Porn, SSN2014 Presentation in Barcelona
Incautious Porn, SSN2014 Presentation in BarcelonaSalvatore Iaconesi
 
Near Future Design - ISIA 6 Marzo 2014
Near Future Design - ISIA 6 Marzo 2014Near Future Design - ISIA 6 Marzo 2014
Near Future Design - ISIA 6 Marzo 2014Salvatore Iaconesi
 
La Cura: an Open Source Cure for Cancer, at Transmediale 2014: Afterglow. In ...
La Cura: an Open Source Cure for Cancer, at Transmediale 2014: Afterglow. In ...La Cura: an Open Source Cure for Cancer, at Transmediale 2014: Afterglow. In ...
La Cura: an Open Source Cure for Cancer, at Transmediale 2014: Afterglow. In ...Salvatore Iaconesi
 
Openness Workshop at Luiss i-Lab
Openness Workshop at Luiss i-Lab Openness Workshop at Luiss i-Lab
Openness Workshop at Luiss i-Lab Salvatore Iaconesi
 
EC(m1) the Cultural Ecosystem of Rome, at Cultur+
EC(m1) the Cultural Ecosystem of Rome, at Cultur+EC(m1) the Cultural Ecosystem of Rome, at Cultur+
EC(m1) the Cultural Ecosystem of Rome, at Cultur+Salvatore Iaconesi
 
Innovation Ecosystems at Internet Festival 2013
Innovation Ecosystems at Internet Festival 2013Innovation Ecosystems at Internet Festival 2013
Innovation Ecosystems at Internet Festival 2013Salvatore Iaconesi
 
Master UX from design to prototype
Master UX from design to prototypeMaster UX from design to prototype
Master UX from design to prototypeSalvatore Iaconesi
 

Plus de Salvatore Iaconesi (20)

Innovation and Trangression: exploring Third Spaces and Excess Spaces
Innovation and Trangression: exploring Third Spaces and Excess SpacesInnovation and Trangression: exploring Third Spaces and Excess Spaces
Innovation and Trangression: exploring Third Spaces and Excess Spaces
 
Third Infoscape, presented at DIS2017 in Edinburgh
Third Infoscape, presented at DIS2017 in EdinburghThird Infoscape, presented at DIS2017 in Edinburgh
Third Infoscape, presented at DIS2017 in Edinburgh
 
La Cura: Erbe Indisciplinate, ricapitolazione
La Cura: Erbe Indisciplinate, ricapitolazioneLa Cura: Erbe Indisciplinate, ricapitolazione
La Cura: Erbe Indisciplinate, ricapitolazione
 
La Cura, Erbe Indisciplinate, presentazione di benvenuto, frame
La Cura, Erbe Indisciplinate, presentazione di benvenuto, frameLa Cura, Erbe Indisciplinate, presentazione di benvenuto, frame
La Cura, Erbe Indisciplinate, presentazione di benvenuto, frame
 
Human Ecosystems and the Ubiquitous Commons at the STARTS program meeting
Human Ecosystems and the Ubiquitous Commons at the STARTS program meetingHuman Ecosystems and the Ubiquitous Commons at the STARTS program meeting
Human Ecosystems and the Ubiquitous Commons at the STARTS program meeting
 
Ubiquitous Commons at NetFutures 2015
Ubiquitous Commons at NetFutures 2015Ubiquitous Commons at NetFutures 2015
Ubiquitous Commons at NetFutures 2015
 
Near Future Design class at Isia Design: Transmedia narratives
Near Future Design class at Isia Design: Transmedia narratives Near Future Design class at Isia Design: Transmedia narratives
Near Future Design class at Isia Design: Transmedia narratives
 
Imaginary Brands
Imaginary BrandsImaginary Brands
Imaginary Brands
 
Ubiquitous Commons workshop at transmediale 2015, Capture All
Ubiquitous Commons workshop at transmediale 2015, Capture AllUbiquitous Commons workshop at transmediale 2015, Capture All
Ubiquitous Commons workshop at transmediale 2015, Capture All
 
Informazione Ubiqua: come è fatto un museo ubiquo?
Informazione Ubiqua: come è fatto un museo ubiquo?Informazione Ubiqua: come è fatto un museo ubiquo?
Informazione Ubiqua: come è fatto un museo ubiquo?
 
Art is Open Source at Visualize: materials and links
Art is Open Source at Visualize: materials and linksArt is Open Source at Visualize: materials and links
Art is Open Source at Visualize: materials and links
 
Near Future Design: the performance of infinite futures
Near Future Design: the performance of infinite futuresNear Future Design: the performance of infinite futures
Near Future Design: the performance of infinite futures
 
Incautious Porn, SSN2014 Presentation in Barcelona
Incautious Porn, SSN2014 Presentation in BarcelonaIncautious Porn, SSN2014 Presentation in Barcelona
Incautious Porn, SSN2014 Presentation in Barcelona
 
Near Future Design - ISIA 6 Marzo 2014
Near Future Design - ISIA 6 Marzo 2014Near Future Design - ISIA 6 Marzo 2014
Near Future Design - ISIA 6 Marzo 2014
 
La Cura: an Open Source Cure for Cancer, at Transmediale 2014: Afterglow. In ...
La Cura: an Open Source Cure for Cancer, at Transmediale 2014: Afterglow. In ...La Cura: an Open Source Cure for Cancer, at Transmediale 2014: Afterglow. In ...
La Cura: an Open Source Cure for Cancer, at Transmediale 2014: Afterglow. In ...
 
Aivot 1: a concept Library
Aivot 1: a concept LibraryAivot 1: a concept Library
Aivot 1: a concept Library
 
Openness Workshop at Luiss i-Lab
Openness Workshop at Luiss i-Lab Openness Workshop at Luiss i-Lab
Openness Workshop at Luiss i-Lab
 
EC(m1) the Cultural Ecosystem of Rome, at Cultur+
EC(m1) the Cultural Ecosystem of Rome, at Cultur+EC(m1) the Cultural Ecosystem of Rome, at Cultur+
EC(m1) the Cultural Ecosystem of Rome, at Cultur+
 
Innovation Ecosystems at Internet Festival 2013
Innovation Ecosystems at Internet Festival 2013Innovation Ecosystems at Internet Festival 2013
Innovation Ecosystems at Internet Festival 2013
 
Master UX from design to prototype
Master UX from design to prototypeMaster UX from design to prototype
Master UX from design to prototype
 

Dernier

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 

Dernier (20)

Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 

Sperimentazioni di Tecnologie e Comunicazioni Multimediali: Lezione 5

  • 1. SPERIMENTAZIONI DI TECNOLOGIE E COMUNICAZIONI MULTIMEDIALI salvatore.iaconesi@artisopensource.net
  • 3. Inside the HTML page <?php ... PHP code ... ?>
  • 4. EXECUTED ON THE SERVER BEFORE GIVING BACK THE PAGE TO THE USER USED TO DYNAMICALLY PRODUCE THE CONTENT OF THE WEB PAGE WE WILL USE THEM TO INTEGRATE INFORMATION COMING FROM A DATABASE OR FROM A CONTENT MANAGEMENT SYSTEM (CMS) INTO WEB AND MOBILE-WEB CONTENT
  • 5. THE IDEA OF THE TEMPLATE IN A “NORMAL” HTML DOCUMENT: <H1>WELCOME Mario!</H1> IN A TEMPLATE: <H1>WELCOME <?php echo( $user_name); ?></H1>
  • 6. <?php echo( $user_name ); ?> IT MEANS THAT THIS PHP INSTRUCTION WILL BE EXECUTED ON THE SERVER BEFORE DELIVERING THE HTML PAGE TO THE USER $user_name is a variable that will contain an information (and in a bit we will see how it is possible to provide it) The welcome greeting will thus be composed by a fixed part and by a dynamic one (maybe the name of the user comes from the database?)
  • 7. CMS BROWSER WEB SERVER PHP DATABASE INTERPRETER
  • 8. The user asks to see a certain web page (using the browser) The request goes to the web server, that forwards it to the CMS The CMS interprets the request as the need to aggregate a series of resources (texts, images, videos, sounds, information, animations...) in order to produce the content that was requested by the server, and selects a template that is fit to composing these resources together. The CMS uses a PHP program (or any other scripting language) to compose the resources into the template Templates are regular HTML documents but in some parts of them Information is replaced by placeholders, by PHP instructions, by loops and by conditions.
  • 9. PLACEHOLDER A placeholder will be replaced by relevant information. For example in the Wordpress CMS there are various types of placeholders. One of them are shortcodes Inserting the shortcode [gallery] means that it will be automatically replaced in the HTML by a browsable gallery of all the images contained in the content that the user has requested. Pretty powerful, isn't it?
  • 10. PHP INSTRUCTIONS They will be executed to produce the content of the page. For example, in an e-commerce site you might have a shopping cart used by the user to buy some products. In the Template you will have variables that contain the unit price (for example $unit_price) and the quantity ($quantity) of a certain product that the user wishes to buy. You could use PHP instructions to show the total cost to the user: <h3>Your total price is: <?php echo( $unit_price * $quantity ); ?></h3> The echo command outputs information to the HTML document. The * means multiply
  • 11. LOOPS Many informations have the same structure. You can use loops to repeat the same task multiple times. For example you could print out all the information of the articles on a certain page by making a loop: <?php for($i = 0; $i < 10 ; $i++){ ?> <div id=”article<?php echo($i) ?>” class=”article-box”> <p><?php echo( $articles[ $i ] ); </p> </div> <?php } ?> The $artices variable is an array. Arrays contain more than one value. You access them by using square brackets. The first value is [0], the second is [1] and so on. You know how many values an array contains by using the count instruction. The array $articles will contain values for $articles[0], $articles[1] and up to (but not including) the number shown by count($articles), meaning $articles[ count( $articles) – 1 ] In the loop, $i++ means “add 1 to $i” and it is the same as writing $i = $i + 1;
  • 12. The FOR LOOP The FOR loop seen in the previous slide has a very useful structure: for ( initialization ; condition ; increment ){ ... instructions to be repeated ... } INITIALIZATION gets executed only once at the beginning of the loop, and it describes where we want to start from (let's say that if we want to count from 0 to 10, we will start at 0 --> $i = 0; in the previous example) CONDITION tells us when we need to stop: whenever the condition is verified the loop goes on with another cycle. In the previous example $i<10 INCREMENT tells us how to proceed, go ahead, in the loop. The increment is executed after each cycle of the loop, and then the condition is checked, to see if there will be another cycle or if the loop has finished looping. In the previous example, increment is $i++ to move forward with our count.
  • 13. CONDITIONS Conditions help you create flexible templates that assume different forms according to different scenarios. For example we could use this condition in our template: <?php if($age<18){ echo( “you are under-age!” ); } else if ($age<90){ echo( “Ok, this content is perfect for you!” ); } else { echo(“You're too old for this!”); } ?> The IF statement is very powerful it can combine multiple IF, IF ELSE, IF ELSE IF ELSE statements and by reading it in plain english it is pretty obvious in what it does. It verifies conditions, one by one (or just one, if there is only a plain IF statement with no ELSE IF or ELSE statements to follow) and as soon as it verifies that one is TRUE (like in 3 < 10 ) it executes the code found in the curly brackets {} right after it. In PHP curly brackets mark blocks of code: these can be used to specify code that should be executed together. Blocks of code can be nested one into each other.
  • 14. GETTING VALUES INTO PHP We can get the values that are used in PHP in several ways: ● Get them from another page, using the GET and POST methods ● For example by creating a form ● Get them from a database (next lessons) ● Synthesize them (by creating them according to some process) The MOST fundamental is the use of GET and POST mechanisms to propagate information from one page to the other.
  • 15. GET As you might have seen, internet addresses are often in a form like this: http://www.aninternetdomain.com/index.php?name1=value1&name2=value2 This internet address is passing values to the “index.php” web page: name1=value1 name2=value2 This method of passing values is called GET and is easily accessible from PHP. For this we can use the $_GET predefined variable (meaning that the system creates it for us): $my_varable = $_GET[“name1”]; In the example, $my_variable will, thus, contain the value “value1” GET is very easy to use, but it has one major limitation: the string of characters after the “?” in the internet address must not be longer than 1024 characters, or it will be cut off. So GET is perfect for every case in which you must not send too much data, and when data can be represented as a string (not to send an image, for example).
  • 16. POST POST method of sending information bypasses the problems of the GET method (content can be as long as you want, and can transfer binary content) but it cannot be easily experimented: to try it out we must create a FORM (next slide) We access POST sent information in much the same way as GET: the system automatically provides us with the $_POST variable that can be used to access information sent through POST methods: $my_variable = $_POST[“name-of-a-very-long-information”];
  • 17. FORMS Forms are HTML elements used to send information to another page: <FORM ACTION=”...” METHOD=”...” > <!-- a series of input fields --> <!-- ... and then a SUBMIT button to send the info --> <INPUT TYPE=”SUBMIT” VALUE=”SEND” /> </FORM> The ACTION parameter specifies who is the information is to be sent to (ex.: if we want to send the info to the “store.php” web page, we will write its name into the ACTION parameter) The METHOD parameter allows us to choose among GET/POST methods of sending info to a web page.
  • 18. FORMS example - first step In one page (let's call it “a.php”) I could have this form: <form method=”POST” action=”b.php”> What is your name?<br /> <input type=”text” name=”user_name” /> <br /> <br /> <input type=”SUMBIT” value=”SEND” /> </form>
  • 19. FORMS example - second step In the other page (let's call it “b.php”) I could have this PHP code: <?php $user_name = “unknown user”; If( isset( $_POST[“user_name”] ){ $user_name = $_POST[“user_name”]; } echo( “Welcome to this webpage ” . $user_name . “ !” ); ?> The isset() command verifies that a certain variable actually exists. For example here we use it to verify that someone is actually sending something from the other page. If this is not the case, the default value we setup at the beginning will be used instead. Strings are joined using a dot. In the echo command, we use the dot “.” symbol to attach the predefined parts of the welcome message to the variable.
  • 20. EXERCISE 1 Write two web pages: - the first one, called “a.php” contains a form, asking for the user's name, and a submit button. The FORM goes to page “b.php” - the second one, called “b.php” takes the input from the first one and prints it out 20 times EXERCISE 2 Write two web pages: - the first one, called “a.php” contains a form, asking for the user's name, a number, and a submit button. The FORM goes to page “b.php” - the second one, called “b.php” takes the input from the first one and prints out the user name a number of times that is equal to the one specified by the user in the second input field. (if the user writes “Mario” and “10”, the name “Mario” will be printed out 10 times)
  • 21. EXERCISE 3 Write two web pages: - the first one, called “a.php” contains a form, asking for the user's name, a text using a TEXTAREA input component, and a submit button. The FORM goes to page “b.php” - the second one, called “b.php” takes the input from the first one and prints it out using the user name for a welcome message and printing out the text the user wrote in the TEXTAREA really big, by adding it to a DIV element in the b.php page whose class attribute points out to a CSS rule with an enormous font. EXERCISE 4 Write two web pages: - the first one, called “a.php” contains a form, asking for the user's name, a select box with a couple of options (you choose them), and a submit button. The FORM goes to page “b.php” - the second one, called “b.php” takes the input from the first one and prints out the user name and, depending on which selection the user made in the select box, print out a custom message (ex.: if the coices were “chocolate” and “vanilla” the messages printed out could be, respectively, “Perfect! Your chocolate ice cream Is coming up!” and “Oh, sorry: We're out of vanilla...”)
  • 22. EXERCISE 5 Write two web pages: - the first one, called “a.php” contains a form, asking for - an “article-type”, through a drop-down menu (select) with values 1,2 and 3 - an article-title - an article-text - and a submit button to send the info - the second one, called “b.php”: - takes the “article-type” parameter and creates a <div> with a different class according to it ( article-type==1 --> class=”article-type-1” and so on) - composes the rest of the article using article-title and article-text - try using CSS rules so that the three article types correspond to radically different renderings on the web page
  • 23. RESOURCES XAMPP To use PHP on your computer you need to install it and a web server. Download and install XAMPP at: - http://www.apachefriends.org/it/xampp.html PHP TUTORIALS - http://www.php.net - http://php.net/manual/en/tutorial.php - http://www.w3schools.com/PHP/ - http://www.homeandlearn.co.uk/php/php.html FORM TUTORIALS - http://www.w3schools.com/html/html_forms.asp - http://www.htmlgoodies.com/tutorials/forms - http://www.phpf1.com/tutorial/php-form.html
  • 24. NEXT STEPS In the next lesson we will use PHP to build our first Wordpress theme. It is really important that you follow the proposed tutorials and try out the examples. See you next time :)