Jump to content

No dynamic variables able to load?


sharp.mac

Recommended Posts

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  :shrug:.

Link to comment
https://forums.phpfreaks.com/topic/211010-no-dynamic-variables-able-to-load/
Share on other sites

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.