note 106949 deleted from features.sessions by tularis
| From: | tularis@php.net | Date: | Thu, 22 Dec 2011 20:37:57 +0000 |
| Subject: | note 106949 deleted from features.sessions by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-185216@lists.php.net to get a copy of this message | ||
Note Submitter: thethinker
Reason: useless
----
Here is a simple demo of session use:
<?php
session_start();
?>
<html>
<head>
<title>Date elevi</title>
</head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF'];?>"
method="post" >
<input type="textbox" name="nume"><br/>
<input type="textbox" name="prenume"><br/>
<input type="submit"><br/>
</form>
<?php
$_SESSION['nume'][]=$_POST['nume'];
$_SESSION['prenume'][]=$_POST['prenume'];
?>
<br/>
<? $nr_elevi=count($_SESSION['nume']);?>
<table cellpadding=5 cellspacing=0 border=0 width="75%">
<tr>
<th>Nume</th>
<th>Prenume</th>
</tr>
<? for ($i = 0; $i < $nr_elevi; $i++){ ?>
<tr>
<td> <? print $_SESSION['nume'][$i];?> </td>
<td> <? print $_SESSION['prenume'][$i];}?> </td>
</tr>
</table>
// <?PHP session_destroy();?> use this one if you want to clear the session evry time you
hit submit
</body>
</html>
hope it helps!!! cheers:D