trying to do somthign liek this: <?php $card1=rand(2, 4); if ($card1==2) echo "you got a 2"; display a picture of the 2 of hearts elseif ($card1==3) echo "you got a 3"; display a picture of the 3 of hearts else ($card1==4) echo "you got a 4"; display a picture of the 4 of hearts ?>
Try this one,change the images path accordingly <?php $card1=rand(2, 4); $img2="./heartimages/heart2.jpg"; $img3="./heartimages/heart3.jpg"; $img4="./heartimages/heart4.jpg"; if ( $card1==2 ) { echo "you got a 2"; echo "<img src=$img2 border='0' >"; } elseif ($card1==3) { echo "you got a 3"; echo "<img src=$img3 border='0' >"; } else { echo "you got a 4"; echo "<img src=$img4 border='0' >"; } ?>