note 106949 added to features.sessions
| From: | thethinker at osu1 dot php dot net | Date: | Tue, 20 Dec 2011 08:32:50 +0000 |
| Subject: | note 106949 added to features.sessions | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-185178@lists.php.net to get a copy of this message | ||
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
----
Server IP: 69.147.83.197
Probable Submitter: 193.231.19.18
----
Manual Page -- http://www.php.net/manual/en/features.sessions.php
Edit -- https://master.php.net/note/edit/106949
Del: integrated -- https://master.php.net/note/delete/106949/integrated
Del: useless -- https://master.php.net/note/delete/106949/useless
Del: bad code -- https://master.php.net/note/delete/106949/bad+code
Del: spam -- https://master.php.net/note/delete/106949/spam
Del: non-english -- https://master.php.net/note/delete/106949/non-english
Del: in docs -- https://master.php.net/note/delete/106949/in+docs
Del: other reasons-- https://master.php.net/note/delete/106949
Reject -- https://master.php.net/note/reject/106949
Search -- https://master.php.net/manage/user-notes.php