Hi i need help with $_session

For programming and general questions on Zend Framework

Hi i need help with $_session

Postby senselessboy2005 on Mon Jan 16, 2012 9:47 am

Hi i have a form that does a search and i have 2 buttons search and reset the search button it's working fine, however the reset button it's the problem
I have attached to it a code
so here's the code
Code: Select all
if($_GET['action'] == 'clear_filters'){
      
       $_SESSION['CALENDAR_SEARCH_ARRAY'] == '';
       
      }


but it seems that the session doesn't get clean
senselessboy2005
 
Posts: 1
Joined: Mon Jan 16, 2012 9:45 am

Re: Hi i need help with $_session

Postby yonman on Mon Jan 16, 2012 10:06 am

Hey Senseless

You'll have to provide with more details about how your form is defined and how you use the reset button.
A code snippet would be very handy here
"It's only hubris if I fail" - Gaius Julius Caesar
User avatar
yonman
 
Posts: 330
Joined: Thu Dec 10, 2009 4:50 pm
Location: Here, There, Everywhere!

Re: Hi i need help with $_session

Postby ilians on Mon Jan 16, 2012 10:47 am

You're using == instead of a single = so you're comparing the session instead of cleaning it.
Make it
Code: Select all
$_SESSION['CALENDAR_SEARCH_ARRAY'] = '';
and it should work.
ilians
 
Posts: 43
Joined: Fri Nov 04, 2011 8:29 am

Re: Hi i need help with $_session

Postby yonman on Mon Jan 16, 2012 10:50 am

well caught, completely missed that :D
"It's only hubris if I fail" - Gaius Julius Caesar
User avatar
yonman
 
Posts: 330
Joined: Thu Dec 10, 2009 4:50 pm
Location: Here, There, Everywhere!


Return to Zend Framework

Who is online

Users browsing this forum: No registered users and 13 guests