1 / 21

PhP -MySQL

PhP -MySQL. Pagora 2012/2013 CTD 2. Première balise. Plusieurs types de balise <? php … ?> <? … ?> <script language =‘ php ’> … </script> Partout !. Hello World. mknk. Simple vs Double quotes. Exercice : Analyse du code. Variables. Variables. Entiers $decimal = 10;

abril
Download Presentation

PhP -MySQL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PhP-MySQL Pagora 2012/2013 CTD 2

  2. Première balise • Plusieurs typesde balise • <?php … ?> • <? … ?> • <script language=‘php’> … </script> • Partout !

  3. Hello World • mknk

  4. Simple vs Double quotes Exercice: Analyse du code

  5. Variables

  6. Variables • Entiers • $decimal = 10; • $hexa = 0x0F; • $octal = 020; • Decimaux • $normal = 0.017; • $scientifique = 17.0E-3; • séquences d'échappement • \n: Nouvelle ligne • \t: Tabulation • \r: Retour chariot • \\: Anti slash • \$: Signe dollar

  7. Variables dynamiques Ellesautorisent en fait àcréerune variable dont le nom est contenudansuneautre variable. Autre syntaxe: ${$first} Permet de désambiguïser lors de manipulation de tableaux: $$tab[1] ? ${$tab[1]} tab [1] contient une variable ${$tab}[1] $tab contient le nom d’une variable (tableau en l’occurrence)

  8. Opérations

  9. Variables Tableaux:

  10. Structure de contrôle: if IF, ELSEIF, ELSE:

  11. Structure de contrôle: switch

  12. Structure de contrôle: while

  13. Structure de contrôle: for BoucleFor: BreakContinue:

  14. Structure de contrôle: foreach

  15. PhP-MySQL Structuration du code: Modularité, inclusion et contrôle

  16. Structuration du code header.php footer.php vars.php

  17. Structuration du code index.php

  18. Structuration du code

  19. Structuration du code Exemple de menu dynamique: http://lmgtfy.com/?q=list+files+php

  20. Aller plus loin… • Les variables d’environnementhttp://www.tiprof.fr/PHP-mySQL/ressources/php/PHP-GuidePlus.html • Et beaucoup d’autres…http://www.tiprof.fr/PHP-mySQL/ressources/php/PHP-GuidePlus.html

  21. Retour aux formulaires: GET, POST Osef.php Ex_form.html Exemple en live…

More Related