Session problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
diane1
Forum Newbie
Posts: 2
Joined: Thu Nov 24, 2005 10:25 am

Session problem

Post by diane1 »

I have three forms. Some of the info is the same on each form. The use can submit from one page the click a link to go to another page. I have the session variables working so that the info from Page 1 shows in page 2, etc. I want user to be able to make changes from any form.
Problem is; Everything is working except if the user highlights text in input box then hits delete button then hits enter button. The variable remains. If user highlights text then hits the spacebar the text is cleared.(which is what I want when they use the delete button).

Any suggestions?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

OK I get what you're saying but I can't see any reason why that would happen other than a logic problem :?

Can you post the code please?
User avatar
trukfixer
Forum Contributor
Posts: 174
Joined: Fri May 21, 2004 3:14 pm
Location: Miami, Florida, USA

Post by trukfixer »

I would simply check all POST values for null or empty , and if so, see if $_SESSION['key_name'] has a value, and if it does, set $_SESSION['key_name'] = "";
diane1
Forum Newbie
Posts: 2
Joined: Thu Nov 24, 2005 10:25 am

Post by diane1 »

Turns out I was not checking if my variables were set correctly. Thank you both for your comments. I got me rethinking my logic.
Post Reply