Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 27th, 2005, 07:30 AM
Registered User
 
Join Date: Jul 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How do i handle session variables in php

I have designed a website in php that uses SESSION feature to store the temporary variable. when a user logs on and fills up a form , the session variables are used to store these inormations. the next page shows what information the user has entered and if the user is happy with that then it stores the info in the sql database on a mouse click. The problem is that when i go back and make changes to the form fields, it is not reflected on the confirmation page which means that the session variables have not been updated. i am using session_upset() to clear the stored values but it is still not working. Any ideas on how can i get it to work.

 
Old July 27th, 2005, 12:59 PM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

Use session_unset(); to delete all session variables.

http://www.mediasworks.com/

 
Old July 27th, 2005, 08:37 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Hard to say without seeing some code.

How are you storing your session information?

You should be using something like:

$_SESSION['var_name'] = 'value';

When clearing a SESSION variable, use unset(), as you would for any other global. session_unset(), clears all session variables. session_destroy() ends a session.

But like I said, I can only speculate why your values aren't updating without seeing some code. Post some of the relevant snips.

Regards,
Rich

--
[http://www.smilingsouls.net]
Mail_IMAP: A PHP/C-Client/PEAR solution for webmail
Author: Beginning CSS: Cascading Style Sheets For Web Design





Similar Threads
Thread Thread Starter Forum Replies Last Post
Session Variables testsubject Visual Studio 2005 8 March 8th, 2006 04:26 PM
How to handle session timeouts? prankur ASP.NET 1.0 and 1.1 Basics 1 January 13th, 2006 02:52 PM
Is it possible for me using session variables into see07 ASP.NET 1.x and 2.0 Application Design 4 March 9th, 2005 07:46 PM
Session Variables flesh_god Dreamweaver (all versions) 7 November 11th, 2003 05:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.