Why wil my code not work..

it dont display the images just the tekst appel1.jpg enz…

<?php // Plaatjes opgeven $afbeelding = array("1"=>"http://i332052.iris.fhict.nl/sinas.jpg", "2"=>"http://i332052.iris.fhict.nl/kers1.jpg", "3"=>"http://i332052.iris.fhict.nl/appel1.jpg"); // De random aangepast van 1 t/m 3 omdat er maar 3 plaatjes zijn $random_kolom1 = mt_rand(1,3); $random_kolom2 = mt_rand(1,3); $random_kolom3 = mt_rand(1,3); // Bepalen welk plaatje in welke kolom kan $plaatje_kolom1 = $afbeelding[$random_kolom1]; $plaatje_kolom2 = $afbeelding[$random_kolom2]; $plaatje_kolom3 = $afbeelding[$random_kolom3]; // Bestandsnaam weergeven op het scherm printf("$plaatje_kolom1 $plaatje_kolom2 $plaatje_kolom3"); ?>

Ok, i’m not good with German|Dutch? but i understand the flow of the code.

To display the image you still need to wrap the image name in an img tag like so

$plaatje_kolom1 = $afbeelding[$random_kolom1];
<img src="<?php echo $plaatje_kolom1; ?>" alt="My Image">

Hope that helps,
Red :wink:

Sponsor our Newsletter | Privacy Policy | Terms of Service