Re: Session tracking and multiple form updates
| From: | John W. Holmes | Date: | Mon, 05 Jul 2004 03:49:57 +0000 |
| Subject: | Re: Session tracking and multiple form updates | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-189686@lists.php.net to get a copy of this message | ||
Tom Rogers wrote:
store it in the session like: $_SESSION[session_id()]['dbkey'] = $dbkey; then get it back with $dbkey = (isset($_SESSION[session_id()]['dbkey']))? $_SESSION[session_id()]['dbkey'] : 0;That doesn't negate the problem of people having more than one window open and editing records in each one. The session_id() is going to be the same for each window, so the last window opened will contain the ID and you'll lose the id for the other windows. The OP could generate a code using uniqid() and store that in a hidden field. Then associate the database id to the unique code generated in the session... $code = uniqid(); $_SESSION['dbkey'][$code] = $id; <input type="hidden" name="code" value="<?=$code?>"> -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals - www.phparch.com