par
yuuzhantar » 03 juin 2007, 16:25
j'ai un petit problème :
voici ma fonction
<?php
header ("Content-type: image/jpg");
$possible=array('/images/lettres/a_1.jpg','/images/lettres/g_1.jpg','/images/lettres/n_1.jpg','/images/lettres/p_1.jpg','/images/lettres/y_1.jpg');
$p1=rand(0, 4);
$p2=rand(0, 4);
$p3=rand(0, 0);
$ad1=$possible[$p1];
$ad2=$possible[$p2];
$ad3=$possible[$p3];
if(
($im1 = imagecreatefromjpeg($ad1))!==false &&
($im2 = imagecreatefromjpeg($ad2))!==false &&
($im3 = imagecreatefromjpeg($ad3))!==false &&
($im = imagecreatetruecolor(90, 30))!==false
)
{
imagecopy ( $im, $im1, 0, 0, 0, 0, 30, 30 );
imagecopy ( $im, $im2, 30, 0, 0, 0, 30, 30 );
imagecopy ( $im, $im3, 60, 0, 0, 0, 30, 30 );
imagejpeg ( $im , NULL,75);
}
?>
et quand je l'appelle
et se ne marche pas
pourquoi ???
merci
j'ai un petit problème :
voici ma fonction
[php]<?php
header ("Content-type: image/jpg");
$possible=array('/images/lettres/a_1.jpg','/images/lettres/g_1.jpg','/images/lettres/n_1.jpg','/images/lettres/p_1.jpg','/images/lettres/y_1.jpg');
$p1=rand(0, 4);
$p2=rand(0, 4);
$p3=rand(0, 0);
$ad1=$possible[$p1];
$ad2=$possible[$p2];
$ad3=$possible[$p3];
if(
($im1 = imagecreatefromjpeg($ad1))!==false &&
($im2 = imagecreatefromjpeg($ad2))!==false &&
($im3 = imagecreatefromjpeg($ad3))!==false &&
($im = imagecreatetruecolor(90, 30))!==false
)
{
imagecopy ( $im, $im1, 0, 0, 0, 0, 30, 30 );
imagecopy ( $im, $im2, 30, 0, 0, 0, 30, 30 );
imagecopy ( $im, $im3, 60, 0, 0, 0, 30, 30 );
imagejpeg ( $im , NULL,75);
}
?>[/php]
et quand je l'appelle
[code]<img src="/scripts/image1.php" border=0 />[/code]
et se ne marche pas
pourquoi ???
merci