Toggle the PHP session variable everytime the page is reloaded -


I have a different requirement that the page is reloaded / refreshed, toggling variable values ​​of php saver every time Want to
say, I have a variable

  $ _ session ['id'] = 1;   

When the page is reloaded, the value should be changed to 0. But when this should not happen then the second page is opened.

My session variable is in page 1. When page 1 is reloaded, then the session variables should be changed. But when we go back to page 2 and come back to page 1, then it should be the same as before. thank you in advanced.

  $ _SESSION ['var'] = empty ($ _ session [var ']) ? 1: 0;    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -