Languages :: PHP :: sessions for form |
|||
| By: VB guy |
Date: 16/07/2003 00:00:00 |
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 | 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 | Type : Comment |
|
| typo in $_SESSSION, should be $_SESSION , oeuf corse. |
|||
| By: cneelus | Date: 16/07/2003 22:32:00 | 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 |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








