Problème au niveau de caractère spéciaux en php

Fermé
wiwi1989 Messages postés 10 Date d'inscription mardi 21 avril 2015 Statut Membre Dernière intervention 7 mai 2015 - 6 mai 2015 à 23:23
jordane45 Messages postés 38145 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 25 avril 2024 - 7 mai 2015 à 00:42
Bonsoir tout le monde svp qui peut m'aider j'ai un
problème au niveau de caractère spéciaux en php.Déja j'ai essayé mais ça marche pas et merci bcp voila mon code et l'affichage de l'eciture.
<?php
require_once ('C:\Program Files\EasyPHP-DevServer-14.1VC11\data\localweb\local\src\jpgraph.php');
require_once ('C:\Program Files\EasyPHP-DevServer-14.1VC11\data\localweb\local\src\jpgraph_bar.php');
require_once ('C:\Program Files\EasyPHP-DevServer-14.1VC11\data\localweb\local\src\jpgraph_line.php');
header('meta http-equiv="Content-Type" content="text/html; charset=UTF-8');
session_start();
header('Content-Type: text/html; charset=iso-8859-1');
$m = $_SESSION['m1'];
$m2 = $_SESSION['m3'];
$m3 = $_SESSION['m4'];
$m4 = $_SESSION['m5'];
$m5 = $_SESSION['m6'];
$m6 = $_SESSION['m7'];
$m7 = $_SESSION['m8'];
$m8 = $_SESSION['m9'];
$m9 = $_SESSION['m10'];
$m10 = $_SESSION['m11'];
$m11 = $_SESSION['m12'] ;
header ("Content-type: image/png");
// donnees des axes Y et X
$ydata = array($m, $m2, $m3, $m4, $m5, $m6, $m7, $m8, $m9, $m10, $m11);
$xdata = array('C1', 'C2', 'C3', 'C4', 'C5', 'C6','C7','C8','C9','C10','C11');
// creation du graphique
$graph = new Graph(count($ydata)*90, 400);
$graph->SetScale("textint");
// style
$graph->SetShadow();
$graph->SetColor('white');
$graph->SetMarginColor('gray6');
$graph->SetMargin(50, 30, 20, 40);// marge gauche, droite, haut, bas
// donner des titres et etiquettes
$graph->title->Set("Resultat audit organisationnel et physique");
$graph->yaxis->title->Set("moyenne");
$graph->xaxis->title->Set("chapitre");
$graph->xaxis->SetTickLabels($xdata);

// creation histogramme
$hist = new BarPlot($ydata);
$hist->SetWidth(0.3) ;
$hist->SetFillColor(array('#6A455D', '#FD3F92', '#D2CAEC','#00CCCB','#FC5D5D','#6600FF','#FF00FF','#FEE7F0','#048B9A','#DD985C','#25FDE9'));
$graph->legend->Pos(0.009,0.06);
$graph->img->SetMargin(40,450,20,30);
$hist1 = new LinePlot($m);
$graph->Add($hist1);
$hist1->SetColor("#6A455D");
$hist1->SetLegend('chapitre1:politique de securité ');
$hist2 = new LinePlot($m2);
$graph->Add($hist2);
$hist2->SetColor("#FD3F92");
$hist2->SetLegend('chapitre2:Organisation de la sécurité');
$hist3 = new LinePlot($m3);
$graph->Add($hist3);
$hist3->SetColor("#D2CAEC");
$hist3->SetLegend('chapitre3:Contrôle et classification des actifs');
$hist4 = new LinePlot($m4);
$graph->Add($hist4);
$hist4->SetColor("#00CCCB");
$hist4->SetLegend('chapitre4:Sécurité liée aux ressources humaines');
$hist5 = new LinePlot($m5);
$graph->Add($hist5);
$hist5->SetColor("#FC5D5D");
$hist5->SetLegend('chapitre5:Sécurité physique et environnementale');
$hist6 = new LinePlot($m6);
$graph->Add($hist6);
$hist6->SetColor("#6600FF");
$hist6->SetLegend('chapitre6:Gestion de l'exploitation et des communications ');
$hist7 = new LinePlot($m7);
$graph->Add($hist7);
$hist7->SetColor("#FF00FF");
$hist7->SetLegend('chapitre7:Contrôle d'accès');
$hist8 = new LinePlot($m8);
$graph->Add($hist8);
$hist8->SetColor("#FEE7F0");
$hist8->SetLegend('chapitre8:Acquisition, maintenance et développement des systèmes ');
$hist9 = new LinePlot($m9);
$graph->Add($hist9);
$hist9->SetColor("#048B9A");
$hist9->SetLegend('chapitre9:Gestion des incidents de sécurité');
$hist10 = new LinePlot($m10);
$graph->Add($hist10);
$hist10->SetColor("#DD985C");
$hist10->SetLegend('chapitre10:Gestion de la continuité d'activité');
$hist11 = new LinePlot($m11);
$graph->Add($hist11);
$hist11->SetColor("#25FDE9");
$hist11->SetLegend('chapitre11:Conformité');


// Positionner la légende


// Couleur de l'ombre et du fond de la légende
//$graph->legend->SetShadow('darkgray@0.5');
//$graph->legend->SetFillColor('lightblue@0.3');




$graph->Add($hist);


//envoi image au format PNG
$graph->img->SetImgFormat("png"); // formats autorises : png, gif, jpg
$graph->Stroke();

?>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
</head>
</html>



<?php
header('Content-Type: text/html; charset=iso-8859-1');
header('meta http-equiv="Content-Type" content="text/html; charset=UTF-8');

header('Content-type: text/html; charset=UTF-8');
?>
A voir également:

2 réponses

Judge_DT Messages postés 29395 Date d'inscription vendredi 5 février 2010 Statut Modérateur Dernière intervention 23 octobre 2021 9 620
Modifié par Judge_DT le 6/05/2015 à 23:25
Salut,

header('meta http-equiv="Content-Type" content="text/html; charset=UTF-8');
session_start();
header('Content-Type: text/html; charset=iso-8859-1'); 


<?php
header('Content-Type: text/html; charset=iso-8859-1');
header('meta http-equiv="Content-Type" content="text/html; charset=UTF-8');

header('Content-type: text/html; charset=UTF-8');
?>



Tu mets de l'ISO, de l'UTF-8, de l'ISO ?

Faudrait être d'accord, sur ce que tu veux. Soit de l'iso, soit de l'utf-8.

Bien à toi,

~ N'oubliez pas que sans précision sur votre problème, notre aide ne peut aboutir, puisque nous ne sommes point Devin, même si certains le pensent ;-)
0
wiwi1989 Messages postés 10 Date d'inscription mardi 21 avril 2015 Statut Membre Dernière intervention 7 mai 2015
7 mai 2015 à 00:16
merci même avec ce code mon problème n'est pas résolu voila mon nouveau code
<?php
require_once ('C:\Program Files\EasyPHP-DevServer-14.1VC11\data\localweb\local\src\jpgraph.php');
require_once ('C:\Program Files\EasyPHP-DevServer-14.1VC11\data\localweb\local\src\jpgraph_bar.php');
require_once ('C:\Program Files\EasyPHP-DevServer-14.1VC11\data\localweb\local\src\jpgraph_line.php');

session_start();
$m = $_SESSION['m1'];
$m2 = $_SESSION['m3'];
$m3 = $_SESSION['m4'];
$m4 = $_SESSION['m5'];
$m5 = $_SESSION['m6'];
$m6 = $_SESSION['m7'];
$m7 = $_SESSION['m8'];
$m8 = $_SESSION['m9'];
$m9 = $_SESSION['m10'];
$m10 = $_SESSION['m11'];
$m11 = $_SESSION['m12'] ;
header ("Content-type: image/png");
// donnees des axes Y et X
$ydata = array($m, $m2, $m3, $m4, $m5, $m6, $m7, $m8, $m9, $m10, $m11);
$xdata = array('C1', 'C2', 'C3', 'C4', 'C5', 'C6','C7','C8','C9','C10','C11');
// creation du graphique
$graph = new Graph(count($ydata)*90, 400);
$graph->SetScale("textint");
// style
$graph->SetShadow();
$graph->SetColor('white');
$graph->SetMarginColor('gray6');
$graph->SetMargin(50, 30, 20, 40);// marge gauche, droite, haut, bas
// donner des titres et etiquettes
$graph->title->Set("Resultat audit organisationnel et physique");
$graph->yaxis->title->Set("moyenne");
$graph->xaxis->title->Set("chapitre");
$graph->xaxis->SetTickLabels($xdata);

// creation histogramme
$hist = new BarPlot($ydata);
$hist->SetWidth(0.3) ;
$hist->SetFillColor(array('#6A455D', '#FD3F92', '#D2CAEC','#00CCCB','#FC5D5D','#6600FF','#FF00FF','#FEE7F0','#048B9A','#DD985C','#25FDE9'));
$graph->legend->Pos(0.009,0.06);
$graph->img->SetMargin(40,450,20,30);
$hist1 = new LinePlot($m);
$graph->Add($hist1);
$hist1->SetColor("#6A455D");
$hist1->SetLegend('chapitre1:politique de securité ');
$hist2 = new LinePlot($m2);
$graph->Add($hist2);
$hist2->SetColor("#FD3F92");
$hist2->SetLegend('chapitre2:Organisation de la sécurité');
$hist3 = new LinePlot($m3);
$graph->Add($hist3);
$hist3->SetColor("#D2CAEC");
$hist3->SetLegend('chapitre3:Contrôle et classification des actifs');
$hist4 = new LinePlot($m4);
$graph->Add($hist4);
$hist4->SetColor("#00CCCB");
$hist4->SetLegend('chapitre4:Sécurité liée aux ressources humaines');
$hist5 = new LinePlot($m5);
$graph->Add($hist5);
$hist5->SetColor("#FC5D5D");
$hist5->SetLegend('chapitre5:Sécurité physique et environnementale');
$hist6 = new LinePlot($m6);
$graph->Add($hist6);
$hist6->SetColor("#6600FF");
$hist6->SetLegend('chapitre6:Gestion de l'exploitation et des communications ');
$hist7 = new LinePlot($m7);
$graph->Add($hist7);
$hist7->SetColor("#FF00FF");
$hist7->SetLegend('chapitre7:Contrôle d'accès');
$hist8 = new LinePlot($m8);
$graph->Add($hist8);
$hist8->SetColor("#FEE7F0");
$hist8->SetLegend('chapitre8:Acquisition, maintenance et développement des systèmes ');
$hist9 = new LinePlot($m9);
$graph->Add($hist9);
$hist9->SetColor("#048B9A");
$hist9->SetLegend('chapitre9:Gestion des incidents de sécurité');
$hist10 = new LinePlot($m10);
$graph->Add($hist10);
$hist10->SetColor("#DD985C");
$hist10->SetLegend('chapitre10:Gestion de la continuité d'activité');
$hist11 = new LinePlot($m11);
$graph->Add($hist11);
$hist11->SetColor("#25FDE9");
$hist11->SetLegend('chapitre11:Conformité');
$graph->Add($hist);
//envoi image au format PNG
$graph->img->SetImgFormat("png"); // formats autorises : png, gif, jpg
$graph->Stroke();

?>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
</head>
</html>

<?php
header('Content-type: text/html; charset=UTF-8');
?>
0
jordane45 Messages postés 38145 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 25 avril 2024 4 650
7 mai 2015 à 00:19
Bonsoir
Où sont les balises de code ??
Cela fait plusieurs fois que je te fais la remarque!
0
wiwi1989 Messages postés 10 Date d'inscription mardi 21 avril 2015 Statut Membre Dernière intervention 7 mai 2015
7 mai 2015 à 00:37
je n'ai pas compris ma faute!!
0
jordane45 Messages postés 38145 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 25 avril 2024 4 650 > wiwi1989 Messages postés 10 Date d'inscription mardi 21 avril 2015 Statut Membre Dernière intervention 7 mai 2015
7 mai 2015 à 00:42
Lorsque tu postes du code sur le forum... tu dois utiliser les balises de code (la coloration syntaxique).
Explications disponibles ici :
https://codes-sources.commentcamarche.net/faq/10686-le-nouveau-codes-sources-comment-ca-marche#balises-code

Merci d'y penser dans tes prochains messages.

Si tu regardes tes précédents messages je l'ai ai édité pour l'ajouter
Je te laisse faire pour celui là.
0