sharp.mac Posted August 17, 2010 Share Posted August 17, 2010 Ok, so I have some basic jquery allowing me to refresh and "hopefully" track _SESSION changes. I am running into a issue where only basic PHP functions and variables can be used inside. jQuery Code Loading PHP page <script type="text/javascript"> var auto_refresh = setInterval( function () { $('#load_options').load('session_options.php'); }, 5000); // refresh every 10000 milliseconds </script> <div id="load_options" style="position:fixed; z-index:100; margin-left:700px; width:200px; padding:10px; background-color:#fff;"> <?php require("session_options.php"); ?> </div> session_options.php <p><?php echo $myNow = date("g:i:s A"); ?></p> <div class="cartinfo"> <h1><b><?php echo $_SESSION['dep_city']; ?>⇒<br /><?php echo $_SESSION['arr_city']; ?></b></h1> <p>Date: <b><?php echo $_SESSION['dep_date']; ?></b></p> <p>Passengers: <b><?php echo $_SESSION['passengers']; ?></b></p> <p>Cost: $<b><?php echo $_SESSION['total']; ?></b></p> <br /> ...blah blah blah What I end up seeing is the Time (WHICH DOES REFRESH PROPERLY) & the static text. HOWEVER, right before the 1st refresh takes place all the variables WORK.... but as soon as that refresh hits... poof "black hole of death". If i include the file with PHP it all works perfectly, but then it won't refresh and update . Link to comment https://forums.phpfreaks.com/topic/211010-no-dynamic-variables-able-to-load/ Share on other sites More sharing options...
MadTechie Posted August 17, 2010 Share Posted August 17, 2010 it seams your missing session_start(); Link to comment https://forums.phpfreaks.com/topic/211010-no-dynamic-variables-able-to-load/#findComment-1100543 Share on other sites More sharing options...
sharp.mac Posted August 17, 2010 Author Share Posted August 17, 2010 session_start(); does exist. The inside.php filer where the javascript is being called. I have even attached it to the session_options.php with no luck Link to comment https://forums.phpfreaks.com/topic/211010-no-dynamic-variables-able-to-load/#findComment-1100544 Share on other sites More sharing options...
sharp.mac Posted August 18, 2010 Author Share Posted August 18, 2010 session_start(); does exist. The index.php file where the javascript is being called. I have even attached it to the session_options.php with no luck Do you think that it is because it's simple not seeing the session? Well I tried another way just now.... When I change it to _GET variables it does some really fun stuff... everything blinks like its on a Christmas tree, BUT the dynamic variables hold. Any other ideas on how to get _SESSION variables to work? Link to comment https://forums.phpfreaks.com/topic/211010-no-dynamic-variables-able-to-load/#findComment-1100679 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.