skedari preference.php
<html>
<head><title>Preference</title></head>
<body>
<?php
if(isset($_COOKIE["preferenca"]))
echo "Preferenca juaj eshte ".$_COOKIE["preferenca"];
else {
?>
<form action="ruajpreference.php" method="POST" name="frm">
<input type="text" name="preference" id="preference"/>
<br>
<input type="submit" value="ruaj"/>
</form>
<?php } ?>
</body>
</html>
skedari ruajpreference.php
<?php
if(isset($_POST["preference"]))
setcookie("preferenca",$_POST["preference"],time()+60);
header('Location: preference.php');
exit();
?>
Rezultati 1:
Ushtrim 1:
pasi kalojne 60 sec :