ghiceste numarul
Scris: Dum Feb 13, 2011
unde am gresit?
Cod: SelectaĊ£i tot
<?php
session_start();
echo '<form method=post action=index.php>
<input type=text name=nr><input type=submit name=submit></form>';
if(isset($_POST['submit']))
{
$_SESSION['numar']=rand(0,100);
if($_POST['nr']>$_SESSION['numar']) echo 'numarul este mai mic';
if($_POST['nr']<$_SESSION['numar']) echo 'numarul este mai mare';
if($_POST['nr']=$_SESSION['numar']){ echo 'ai castigat';
$_SESSION['numar']='';}
}