Bonjour,
Je me présente Jérôme généralement je reste que sur du xhtml css et jquery en langages, mais j'ai voulut testé un nouveau projet, étant débutant en php je doit avoué que de l'aide sur la finalisation de mon projet et de réglage pour que cela fonctionne sous ie serai la bienvenue :$, je me permet de vous contacté dû a un problème de codage sous php en effet:
mon script fonction très bien sous firefox, chrome et opera mais sous ie il n’exécute pas mon scripte complément :s
Je m'explique ^^
j'ai mon scripte qui sert a comparer le nombre entrer dans un champs et par rapport au nombre entrer il fixe une bars avec la valeur dessus exemple:
http://www.site.sitinweb.fr/jerome/teste/new/index.php
mon problème c'est que sous ie de 0 a 50 pas de souci fonctionne très bien mais a partir de 51 plus rien ne marche pas d’aperçu rien :s
pour mieux comprendre voici mon scripte php:
<?php
if($_POST['dpe']>=0 && $_POST['dpe']<=50)
{
$font = 18;
$width = ImageFontWidth($font) * strlen($_POST['dpe']);
$height = ImageFontHeight($font);
$fichier="images/1.jpg";
$im = ImageCreateFromJpeg ($fichier);
$text_color = imagecolorallocate ($im, 255,255,255);
imagestring ($im, $font, 398, 76, $_POST['dpe'], $text_color);
header("Content-type: image/jpeg");
imagejpeg ($im);
imagejpeg ($im, 'resultat.jpg', 100);
imagedestroy($im);
}
else if($_POST['dpe']>=51 && $_POST['dpe']<=90)
{
$font = 18;
$width = ImageFontWidth($font) * strlen($_POST['dpe']);
$height = ImageFontHeight($font);
$fichier="images/2.jpg";
$im = ImageCreateFromJpeg ($fichier);
$text_color = imagecolorallocate ($im, 255,255,255);
imagestring ($im, $font, 398, 122, $_POST['dpe'], $text_color);
header("Content-type: image/jpg");
imagejpeg ($im);
imagejpeg ($im, 'resultat.jpg', 100);
imagedestroy($im);
}
else if($_POST['dpe']>=91 && $_POST['dpe']<=150)
{
$font = 18;
$width = ImageFontWidth($font) * strlen($_POST['dpe']);
$height = ImageFontHeight($font);
$fichier="images/3.jpg";
$im = ImageCreateFromJpeg ($fichier);
$text_color = imagecolorallocate ($im, 255,255,255);
imagestring ($im, $font, 398, 172, $_POST['dpe'], $text_color);
header("Content-type: image/jpg");
imagejpeg ($im);
imagejpeg ($im, 'resultat.jpg', 100);
imagedestroy($im);
}
else if($_POST['dpe']>=151 && $_POST['dpe']<=230)
{
$font = 18;
$width = ImageFontWidth($font) * strlen($_POST['dpe']);
$height = ImageFontHeight($font);
$fichier="images/4.jpg";
$im = ImageCreateFromJpeg ($fichier);
$text_color = imagecolorallocate ($im, 255,255,255);
imagestring ($im, $font, 398, 216, $_POST['dpe'], $text_color);
header("Content-type: image/jpg");
imagejpeg ($im);
imagejpeg ($im, 'resultat.jpg', 100);
imagedestroy($im);
}
else if($_POST['dpe']>=231 && $_POST['dpe']<=330)
{
$font = 18;
$width = ImageFontWidth($font) * strlen($_POST['dpe']);
$height = ImageFontHeight($font);
$fichier="images/5.jpg";
$im = ImageCreateFromJpeg ($fichier);
$text_color = imagecolorallocate ($im, 255,255,255);
imagestring ($im, $font, 398, 262, $_POST['dpe'], $text_color);
header("Content-type: image/jpg");
imagejpeg ($im);
imagejpeg ($im, 'resultat.jpg', 100);
imagedestroy($im);
}
else if($_POST['dpe']>=331 && $_POST['dpe']<=450)
{
$font = 18;
$width = ImageFontWidth($font) * strlen($_POST['dpe']);
$height = ImageFontHeight($font);
$fichier="images/6.jpg";
$im = ImageCreateFromJpeg ($fichier);
$text_color = imagecolorallocate ($im, 255,255,255);
imagestring ($im, $font, 398, 306, $_POST['dpe'], $text_color);
header("Content-type: image/jpg");
imagejpeg ($im);
imagejpeg ($im, 'resultat.jpg', 100);
imagedestroy($im);
}
else
{
$font = 18;
$width = ImageFontWidth($font) * strlen($_POST['dpe']);
$height = ImageFontHeight($font);
$fichier="images/7.jpg";
$im = ImageCreateFromJpeg ($fichier);
$text_color = imagecolorallocate ($im, 255,255,255);
imagestring ($im, $font, 398, 355, $_POST['dpe'], $text_color);
header("Content-type: image/jpg");
imagejpeg ($im);
imagejpeg ($im, 'resultat.jpg', 100);
imagedestroy($im);
}
?>
et mon html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" href="/css/template.css" type="text/css" />
</head>
<body>
<div class="php">
<form action="teste3.php" method="post" target="mainFrame">
<input type="text" name="dpe" />
<input type="submit" value="valider" />
</form>
<iframe name="mainFrame" src="images/1.jpg" width="477" height="437" frameBorder="0">
</iframe>
<br />clique <a href='resultat.jpg'>ici</a> pour telecharger l'image.
</div>
</body>
</html>
j'ai mis l'aperçu dans une iframe c'est sur cela n'est pas top c'est même dépassé mais juste pour testé .
je pense a un problème de succession de création d'image avec la balise "header("Content-type: image/jpg");"
En espérant d'être claire dans ma demande et de savoir m'orienté sur ma faute mon scripte php.
En vous remerciant.