Valid XHTML    Valid CSS2    

Listing du fichier eltattres.php

 

00001     <?php
00002     #    (gH)   -_-  eltattres.php  ;  TimeStamp (unix) : 17 Mars 2010 vers 12:36
00003     
00004     error_reporting
(E_ALL) ;
00005     include("../std.php"
) ;
00006     include("eltatt_inc.php"
) ;
00007     debutPage
("Eléments et attributs","strict") ;
00008     debutSection
() ;
00009     
00010     #############################################################################
00011     
00012     if ( (!isset(
$_GET["url"])) or (strlen(trim($_GET["url"]))==0) ) {
00013     
00014       h1
("Aucune URL fournie, rien à faire !") ;
00015     
00016     } else {
00017     
00018          $url 
$_GET["url"] ;
00019          h1
("Analyse des éléments et attributs de la page Web ") ;
00020          blockquote
() ;
00021          h1
(href($url)) ;
00022          finblockquote
() ;
00023     
00024          $tabres 
analysePage($url) ;
00025     
00026          $idr 
= -;
00027          $idr
++ ; $codret $tabres[$idr] ;
00028          $idr
++ ; $nbelt  $tabres[$idr] ;
00029          $idr
++ ; $nbatt  $tabres[$idr] ;
00030          $idr
++ ; $nbcmt  $tabres[$idr] ;
00031          $idr
++ ; $nbfds  $tabres[$idr] ;
00032          $idr
++ ; $nbfjs  $tabres[$idr] ;
00033          $idr
++ ; $tabdet $tabres[$idr] ;
00034          $idr
++ ; $tabatr $tabres[$idr] ;
00035     
00036          if ($codret
==0) {
00037     
00038               h2
("En bref") ;
00039     
00040               blockquote
() ;
00041               p
() ;
00042               echo 
$nbelt élément(s), $nbatt attribut(s), $nbcmt commentaires, " ;
00043               br
() ;
00044               echo 
$nbfds feuille(s) de style et $nbfjs fichier(s) javascript." ;
00045               finp
() ;
00046               finblockquote
() ;
00047     
00048               h2
("En détail") ;
00049     
00050               blockquote
() ;
00051     
00052               table
(1,15,"collapse") ;
00053               tr
() ;
00054                 th
("C","jaune_pastel") ;
00055                   echo " Numéro " 
;
00056                 finth
() ;
00057                 th
("C","jaune_pastel") ;
00058                   echo " Elément " 
;
00059                 finth
() ;
00060                 th
("C","jaune_pastel") ;
00061                   echo " Occurrences" 
;
00062                 finth
() ;
00063                 th
("L","jaune_pastel") ;
00064                   nbsp
(3) ;
00065                   echo "Attributs éventuels" 
;
00066                 finth
() ;
00067               fintr
() ;
00068     
00069               $numElt 
;
00070               foreach ($tabdet 
as $cle=>$valeur) {
00071               $numElt
++ ;
00072               tr
() ;
00073                 td
("R") ;
00074                   echo s_span
("&nbsp;&nbsp;".$numElt."&nbsp;&nbsp;","gvert") ;
00075                 fintd
() ;
00076                 td
() ;
00077                   $clef 
preg_replace("/</","&lt;",$cle) ;
00078                   $clef 
preg_replace("/>/","&gt;",$clef) ;
00079                   echo s_span
($clef,"gbleu") ;
00080                 fintd
() ;
00081                 td
("R") ;
00082                   echo $valeur 
;
00083                   nbsp
(3) ;
00084                 fintd
() ;
00085                 td
() ;
00086                   $vat 
$tabatr[$cle] ;
00087                   $vat 
preg_replace("/</","&lt;",$vat) ;
00088                   $vat 
preg_replace("/>/","&gt;",$vat) ;
00089                   echo $vat 
;
00090                 fintd
() ;
00091               fintr
() ;
00092               } ; # fin pour
00093     
00094               fintable
() ;
00095     
00096               finblockquote
() ;
00097     
00098               h2
("Texte analysé") ;
00099     
00100               codeHtml
($url) ;
00101     
00102          } ; # fin si sur coderet
00103     
00104     } ; 
# fin si sur url
00105     #############################################################################
00106     finSection
() ;
00107     finPage
() ;
00108     ?>

La coloration syntaxique est réalisée par un enrobage de la function php nommée highlight_file

mais si vous préférez, vous pouvez utiliser celle de SyntaxHighlighter ou même celle de geshi.

Pour ne pas voir les numéros de ligne, ajoutez &nl=non à la suite du nom du fichier.

 

 

retour gH    Retour à la page principale de   (gH)