shaung Posted December 24, 2013 Share Posted December 24, 2013 (edited) Simple question about scope. I want to run different sql statements depending on a boolean value in a variable. The value would flip back and forth depending what the user is doing. What/where is the best way to initialize this variable (initially false). The page might reload (on a submit or whatever), but I want the variable to remember it's value. Thanks. Edited December 24, 2013 by shaung Quote Link to comment Share on other sites More sharing options...
jcbones Posted December 24, 2013 Share Posted December 24, 2013 session_start(); $_SESSION['variable'] = (isset($_SESSION['variable'])) ? $_SESSION['variable'] : false; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.