For me to better explain this you will need to go to my site GoURL.Biz and click "Forwarding Options". Here you will be able to enable and disable the preview feature. When you press enable, it creates a cookie to store that setting, just like when you press disable. The cookie is called towards the end of the script to determine which of the drop-down menus is "selected". For example, if you have preview enabled, when you load the page, it should automatically show "enabled". However when you visit that page and change the variable (lets say to from disable to enable), when the page loads again it shows the old setting. If you re-visit that page (NOT refresh), it shows the correct setting. I want it to show the correct setting immediately after it has been changed. The very first thing in that script is the setting of the cookies depending on which option you have chosen. Later down the script, it calls the cookie. Are you allowed to set a cookie, then call it within the same script ?
Set the cookie to the value but also store the value in a variable that your script can use. When you need to check the cookie see if the cookie value is set and if it is use that otherwise use the variable that holds the value that is stored in the cookie. $setting = 1; cookie = $setting; if(isset(cookie)) $setting = cookie; if($setting) blah else other blah Code (markup):