rendered paste body<?php
$tiedosto = "adjektiivit.txt";
$tied = file($tiedosto);
$adj = $tied[mt_rand(0, count($tied)-1)];
$tiedosto2 = "substanttiivi.txt";
$tied2 = file($tiedosto2);
$subs = $tied2[mt_rand(0, count($tied2)-1)];
$tiedosto3 = "verbit.txt";
$tied3 = file($tiedosto3);
$verbs = $tied3[mt_rand(0, count($tied3)-1)];
$tiedosto4 = "objekti.txt";
$tied4 = file($tiedosto4);
$obj = $tied4[mt_rand(0, count($tied4)-1)];
$tiedosto5 = "milla.txt";
$tied5 = file($tiedosto5);
$milla = $tied5[mt_rand(0, count($tied5)-1)];
$tiedosto6 = "missa.txt";
$tied6 = file($tiedosto6);
$missa = $tied6[mt_rand(0, count($tied6)-1)];
$tulosta = "$adj $subs $verbs $obj $milla $missa";
$f = fopen("random.txt", "w");
fwrite($f, $tulosta);
fclose($f);
?>
<?php
header("Content-type: image/png");
$pic = imagecreate(310, 80); //Luodaan 200x230 kokoinen kuva
$t = imagecolorallocate($pic, 255, 255, 255); //Tausta väri
$black = imagecolorallocate($img,0,0,0);
$font1 = "arial.ttf";
$font2 = "arial.ttf";
imagefilledrectangle($pic, 0, 0, 310, 80, imagecolorallocate($pic, 255, 0, 0));
$text = "Lausegeneraattori:";
imagettftext($pic,13,0,2,13,$black,$font1,$text);
$tiedosto = file("random.txt");
$jeejee = $tiedosto[0];
$jeejee2 = $tiedosto[1];
$jeejee3 = $tiedosto[2];
$jeejee4 = $tiedosto[3];
$jeejee5 = $tiedosto[4];
$jepso = "$jeejee $jeejee2 $jeejee3 $jeejee4 $jeejee5";
imagettftext($pic,8,0,9,39,$black,$font2,$jepso);
imagepng($pic);
imagedestroy($pic); //eliminoidaan kuva pois muistista
?>