IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

Page blanche avec index.php


Sujet :

Langage PHP

  1. #1
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2012
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2012
    Messages : 19
    Points : 19
    Points
    19
    Par défaut Page blanche avec index.php
    Bonjour à tous,
    j'ai un problème de page blanche (code source vide) avec ma page index.php.

    Je viens de me mettre sous Debian.
    J'ai installé pmb http://www.pmbservices.fr/nouveau_si...elogiciel.html et installé qui marche très bien sur mon windows... mais là, j'ai un bug de page blanche sur la page index.php.
    Je n'ai aucune erreur dans le log de php...

    echo fonctionne sur la page jusqu'à cette ligne :
    include_once("$class_path/XMLlist.class.php");

    après ca ne marche plus.

    Alors je me demande si je n'ai pas un bug avec xml... bref, n'étant pas grand connaisseur, j'aurai besoin d'aide... si vous voulez m'aider.
    Merci

  2. #2
    Membre éprouvé Avatar de patrickbaras
    Homme Profil pro
    Informaticien (à sa mémère).
    Inscrit en
    Septembre 2010
    Messages
    525
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 60
    Localisation : Belgique

    Informations professionnelles :
    Activité : Informaticien (à sa mémère).
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Septembre 2010
    Messages : 525
    Points : 1 103
    Points
    1 103
    Par défaut
    var_dump donne quoi ?
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    var_dump ($class_path);
    include_once("$class_path/XMLlist.class.php");
    ce message vous a aidé ! Un petit click sur fait toujours plaisir

    "Nos études ont montré que la probabilité qu’un programme corrigé fonctionne comme avant la correction est seulement de cinquante pour cent." Bev Littlewood & Lorenzo Strigini

    "Le logiciel, c’est comme le sexe, c’est meilleur quand c’est libre/gratuit." Linus Torvalds

  3. #3
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2012
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2012
    Messages : 19
    Points : 19
    Points
    19
    Par défaut
    Voilà le message affiché :
    string(7) "classes"

    En fait j'ai déjà ouvert le document XMLlist.class.php mais je vois pas trop le problème !!!
    quand je met un echo dans ce doc, il n'apparaît pas...

    Si jamais, voilà son contenu :
    Merci pour votre aide

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
     
    <?php
    // +-------------------------------------------------+
    // © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
    // +-------------------------------------------------+
    // $Id: XMLlist.class.php,v 1.21 2010-08-20 15:02:29 mbertin Exp $
     
    if (stristr($_SERVER['REQUEST_URI'], ".class.php")) die("no access");
     
    // classe de gestion des documents XML
     
    if ( ! defined( 'XML_LIST_CLASS' ) ) {
      define( 'XML_LIST_CLASS', 1 );
     
    class XMLlist {
     
    	var $analyseur;
    	var $fichierXml;
    	var $fichierXmlSubst; // nom du fichier XML de substitution au cas où.
    	var $current;
    	var $table;
    	var $tablefav;
    	var $flag_fav;
    	var $s;
    	var $flag_elt ; // pour traitement des entrées supprimées
    	var $flag_order;
    	var $order;
     
    	// constructeur
    	function XMLlist($fichier, $s=1) {
    		$this->fichierXml = $fichier;
    		$this->fichierXmlSubst = str_replace(".xml", "", $fichier)."_subst.xml" ;
    		$this->s = $s;
    		$this->flag_order = false;		
    	}
     
     
    	//Méthodes
    	function debutBalise($parser, $nom, $attributs) {
    		global $_starttag; $_starttag=true;
    		if($nom == 'ENTRY' && $attributs['CODE'])
    			$this->current = $attributs['CODE'];
    		if($nom == 'ENTRY' && $attributs['ORDER']) {
    			$this->flag_order = true;
    			$this->order[$attributs['CODE']] =  $attributs['ORDER'];
    			}			
    		if($nom == 'XMLlist') {
    			$this->table = array();
    			$this->fav = array();
    		}
    	}
     
    	//Méthodes
    	function debutBaliseSubst($parser, $nom, $attributs) {
    		global $_starttag; $_starttag=true;
    		if($nom == 'ENTRY' && $attributs['CODE']) {
    			$this->flag_elt = false ;
    			$this->current = $attributs['CODE'];
    			}
    		if($nom == 'ENTRY' && $attributs['ORDER']) {
    			$this->flag_order = true;
    			$this->order[$attributs['CODE']] =  $attributs['ORDER'];
    			}
    		if($nom == 'ENTRY' && $attributs['FAV']) {
    			$this->flag_fav =  $attributs['FAV'];
    			}
    	}
     
    	function finBalise($parser, $nom) {
    		// ICI pour affichage des codes des messages en dur 
    		if ($_COOKIE[SESSname."-CHECK-MESSAGES"]==1 && strpos($this->fichierXml, "messages")) {
    			$this->table[$this->current] = "__".$this->current."**".$this->table[$this->current];
    		} 
    		$this->current = '';
    		}
     
    	function finBaliseSubst($parser, $nom) {
    		// ICI pour affichage des codes des messages en dur 
    		if ($_COOKIE[SESSname."-CHECK-MESSAGES"]==1 && strpos($this->fichierXml, "messages")) {
    			$this->table[$this->current] = "__".$this->current."**".$this->table[$this->current];
    		} 
    		if ((!$this->flag_elt) && ($nom=='ENTRY')) unset($this->table[$this->current]) ;
    		$this->current = '';
    		$this->flag_fav =  false;
    		}
     
    	function texte($parser, $data) {
    		global $_starttag; 
    		if($this->current)
    			if ($_starttag) {
    				$this->table[$this->current] = $data;
    				$_starttag=false;
    			} else $this->table[$this->current] .= $data;
    		}
     
    	function texteSubst($parser, $data) {
    		global $_starttag; 
    		$this->flag_elt = true ;
    		if ($this->current) {
    			if ($_starttag) {
    				$this->table[$this->current] = $data;
    				$_starttag=false;
    			} else $this->table[$this->current] .= $data;
    			$this->tablefav[$this->current] = $this->flag_fav;
    		}
    	}
     
     
     // Modif Armelle Nedelec recherche de l'encodage du fichier xml et transformation en charset'
     	function analyser() 
     	{
     		global $charset;
    		if (!($fp = @fopen($this->fichierXml, "r"))) {
    			die("impossible d'ouvrir le fichier XML $this->fichierXml");
    			}
    		$file_size=filesize ($this->fichierXml);
    		$data = fread ($fp, $file_size);
     
     		$rx = "/<?xml.*encoding=[\'\"](.*?)[\'\"].*?>/m";
    		if (preg_match($rx, $data, $m)) $encoding = strtoupper($m[1]);
    			else $encoding = "ISO-8859-1";
     
     		$this->analyseur = xml_parser_create($encoding);
     		xml_parser_set_option($this->analyseur, XML_OPTION_TARGET_ENCODING, $charset);		
    		xml_parser_set_option($this->analyseur, XML_OPTION_CASE_FOLDING, true);
    		xml_set_object($this->analyseur, &$this);
    		xml_set_element_handler($this->analyseur, "debutBalise", "finBalise");
    		xml_set_character_data_handler($this->analyseur, "texte");
     
    		fclose($fp);
     
    		if ( !xml_parse( $this->analyseur, $data, TRUE ) ) {
    			die( sprintf( "erreur XML %s à la ligne: %d ( $this->fichierXml )\n\n",
    			xml_error_string(xml_get_error_code( $this->analyseur ) ),
    			xml_get_current_line_number( $this->analyseur) ) );
    		}
     
    		xml_parser_free($this->analyseur);
     
    		if ($fp = @fopen($this->fichierXmlSubst, "r")) {
    			$file_sizeSubst=filesize ($this->fichierXmlSubst);
    			if($file_sizeSubst) {
    				$data = fread ($fp, $file_sizeSubst);
    				fclose($fp);
    		 		$rx = "/<?xml.*encoding=[\'\"](.*?)[\'\"].*?>/m";
    				if (preg_match($rx, $data, $m)) $encoding = strtoupper($m[1]);
    					else $encoding = "ISO-8859-1";
    				$this->analyseur = xml_parser_create($encoding);
    				xml_parser_set_option($this->analyseur, XML_OPTION_TARGET_ENCODING, $charset);		
    				xml_parser_set_option($this->analyseur, XML_OPTION_CASE_FOLDING, true);
    				xml_set_object($this->analyseur, &$this);
    				xml_set_element_handler($this->analyseur, "debutBaliseSubst", "finBaliseSubst");
    				xml_set_character_data_handler($this->analyseur, "texteSubst");
    				if ( !xml_parse( $this->analyseur, $data, TRUE ) ) {
    					die( sprintf( "erreur XML %s à la ligne: %d ( $this->fichierXmlSubst )\n\n",
    					xml_error_string(xml_get_error_code( $this->analyseur ) ),
    					xml_get_current_line_number( $this->analyseur) ) );
    					}
    				xml_parser_free($this->analyseur);
    			}	
    		}
    		if ($this->s && is_array($this->table)) {
    			reset($this->table);
    			$tmp=array();
    			$tmp=array_map("convert_diacrit",$this->table);//On enlève les accents
    			$tmp=array_map("strtoupper",$tmp);//On met en majuscule
    			asort($tmp);//Tri sur les valeurs en majuscule sans accent
    			foreach ( $tmp as $key => $value ) {
           			$tmp[$key]=$this->table[$key];//On reprend les bons couples clé / libellé
    			}
    			$this->table=$tmp;
    		}
    		if($this->flag_order == true){
    			$table_tmp = array();
    			asort($this->order);
    			foreach ($this->order as $key =>$value){
    				$table_tmp[$key] = $this->table[$key];
    				unset($this->table[$key]);
    			}
    			$this->table = array_merge($table_tmp,$this->table);
    		}
    	}
    }
     
    } # fin de définition

  4. #4
    Membre éprouvé Avatar de patrickbaras
    Homme Profil pro
    Informaticien (à sa mémère).
    Inscrit en
    Septembre 2010
    Messages
    525
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 60
    Localisation : Belgique

    Informations professionnelles :
    Activité : Informaticien (à sa mémère).
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Septembre 2010
    Messages : 525
    Points : 1 103
    Points
    1 103
    Par défaut
    XMLlist.class.php est bien dans le sous_répertoire classes/
    tu ne vois pas ton echo car je pense que le fichier n'est pas déjà inclus quand tu a l'erreur.
    ce message vous a aidé ! Un petit click sur fait toujours plaisir

    "Nos études ont montré que la probabilité qu’un programme corrigé fonctionne comme avant la correction est seulement de cinquante pour cent." Bev Littlewood & Lorenzo Strigini

    "Le logiciel, c’est comme le sexe, c’est meilleur quand c’est libre/gratuit." Linus Torvalds

  5. #5
    Membre à l'essai
    Homme Profil pro
    Étudiant
    Inscrit en
    Juin 2012
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : France, Haut Rhin (Alsace)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Juin 2012
    Messages : 19
    Points : 19
    Points
    19
    Par défaut
    Oui il est bien dans classes.
    La page est bien appelé car si j'enlève un ; à un endroit de ce class.php, la page m'affiche une erreur !

Discussions similaires

  1. [2.x] page blanche avec app.php, mais pas avec app_dev.php (page OK)
    Par lou_lou43 dans le forum Symfony
    Réponses: 12
    Dernier message: 15/05/2012, 15h17
  2. [IIS] Page blanche en installant php avec IIS
    Par soso78 dans le forum IIS
    Réponses: 4
    Dernier message: 07/12/2010, 10h06
  3. Page blanche avec SOAP php
    Par herve32 dans le forum XML/XSL et SOAP
    Réponses: 0
    Dernier message: 16/09/2010, 23h13
  4. Mon site affiche une page blanche avec Firefox : Pourquoi ? Que faire ?
    Par bnoir dans le forum Général Conception Web
    Réponses: 3
    Dernier message: 25/10/2006, 16h22
  5. Impression de pages blanches avec mon imprimante.
    Par JavaAcro dans le forum Périphériques
    Réponses: 11
    Dernier message: 07/04/2006, 08h09

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo