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
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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.