spanzuratoare
Scris: Vin Mar 11, 2011
stiu ca este fff prost facut....dar daca mai putea ajuta Multumesc
Cod: Selectaţi tot
<?php
session_start();
$cuvinte=array('elefant','vulpita','juverdeanu');
$litere=array('a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','w','u','v','z','y','x');
$random=rand(0,2);
echo '<form method=post action=index2.php>
scrie litera:<input type=text name=litera><br>
<input type=submit name=submit></form>';
if(isset($_POst['submit']))
{
$_SESSION['greseli']=$greseli;
$_SESSION['greseli']=0;
$cuvant_nou='';
$_SESSION['cuvant']=$cuvinte[$random];
$_SESSION['litera']=$_POST['litera'];
$impartit=explode($_SESSION['cuvant'],' ');
for($i=0;$i<strlen($_SESSION['cuvant']);$i++){
if($impartit[$i]==$_SESSION['litera']){echo $cuvant_nou=$_SESSION['litera'];}
else
$_SESSION['greseli']++;
}
}
echo $greseli;
?>