visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
294 experts, 1172 registered users, 1625 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


The DDRK link is back online.
We got a one week service interruption, sorry.
(23-30/01/2010)

Languages :: PHP :: sessions for form


By: VB guy Canada  Date: 16/07/2003 00:00:00  English  Points: 100 Status: Answered
Quality : Excellent
I am new to sessions and I only have a vague idea of what it accomplishes. I think it will allow multiple users of my form without their values interfering with each other in the post data. Is that right? If so or if not, what do I need to do to make my form usable by everybody at once?
By: VGR Date: 16/07/2003 21:56:00 English  Type : Answer
yes, but even the $_POST data is privy to each user (each connection/browser instance, in fact)

session variables are useful to share data between pages on the same site.

like this :

<?php
// page 1
//
session_start(); // this is required on all pages sharing data
// perform some login that sets the (local) variable $isAdmin (say it's 0 or 1)
$_SESSSION['admin']=$isAdmin;
// rest of the page
echo '<a href=page2.php>goto page 2</A>';
?>

<?php
// page2
//
session_start();
echo 'as per the session data, are you administrator ? : '.(($_SESSION['admin']==1)?'yes':'no');
// rest of the page
?>
By: VGR Date: 16/07/2003 21:57:00 English  Type : Comment
typo in $_SESSSION, should be $_SESSION , oeuf corse.
By: cneelus Date: 16/07/2003 22:32:00 English  Type : Comment
Go Through this link you have a clear explanation of sessions
<A HREF="http://in.php.net/session">http://in.php.net/session</a>

Do register to be able to answer

 Add This Article To:
 del.icio.usDel.icio.us  diggDigg  googleGoogle  spurlSpurl
 blinkBlink  wongWong  simpySimpy  yahooY! MyWeb 
EContact
browser fav
page generated in 62.730070 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page