wamp et création d'image en php
Bonjour
Avec wamp je n’arrive pas à afficher un rectangle orange, j'obtiens un carre avec une croix rouge, avec ces codes:
page 1
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| <!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Document sans titre</title>
</head>
<body>
<img src="image.php" />
</body>
</html> |
Page 2
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| <?php
header ("Content-type: image/png");
$image = imagecreate(200,50);
$orange = imagecolorallocate($image, 255, 128, 0);
$bleu = imagecolorallocate($image, 0, 0, 255);
$bleuclair = imagecolorallocate($image, 156, 227, 254);
$noir = imagecolorallocate($image, 0, 0, 0);
$blanc = imagecolorallocate($image, 255, 255, 255);
imagepng($image);
?> |
même chose avec:
Code:
1 2 3 4
| <?php
header ("Content-type: image/jpeg");
$image = imagecreatefromjpeg("couchersoleil.jpg");
?> |
php_gd2. Est bien coché dans wamp, j’affiche d’autres pages sans problème. Tout se trouve dans le même dossier
Ou est mon erreur. Merci de vos réponses