shaung Posted December 24, 2013 Share Posted December 24, 2013 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. Link to comment https://forums.phpfreaks.com/topic/284918-scope-question/ 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; Link to comment https://forums.phpfreaks.com/topic/284918-scope-question/#findComment-1463059 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.