Jump to content

tracking a var


M.O.S. Studios

Recommended Posts

where do you want the variable to go? You could visually track it by just echoing... or create an array and just use the array push function to add a variable at different events and print all the values to see the progress of the variable.

 

$bob = array();

$bob[0] = $my_var;


//then later on inside of script just do this.

array_push($bob,$my_var); // will add $my_var at this point to next avaible element... so first time around this will add to $bob[1]... and so on and so forth.

Link to comment
Share on other sites

Oh in session... hmmm.

 

Best thing on that, that I can think of is at begin of every area that uses the session try printing the array content...

Pain staking... but I don't know of any other way in that case. Maybe bumping this thread with this reply might get a response from someone who knows more.

 

could do a search for unset or the variable itself in the scripts that are using it...  maybe being overwritten with a null value or reset somewhere along the lines perhaps. About slightly just a hair less time consuming then printing it...

Link to comment
Share on other sites

The fact that you started a new thread for this problem when you already have a thread, means that you lost all the information you already posted, such as the code you have tried, where this works and does not, and that it is using session variables.

 

Some reason you did not continue with your existing thread?

Link to comment
Share on other sites

probably because he had no response to an overcomplicated question. I didn't even realize was same person. Ha... Anyways... do as ken states. Be sure that you have session_starts at the top of the second page and you are not closing the session prior to the second page. session_start is needed on every page that uses that same session if you do not have it already.

 

apon looking at your other post here's the problem possibly...if the same project... your session_start is below the where you are trying to get the session_id.... needs to be the other way around.

<?php
SESSION_ID($_GET['sid']);
SESSION_START();

print_r($_SESSION);
?>

//try this instead
<?php
SESSION_START();
SESSION_ID($_GET['sid']);


print_r($_SESSION);
?>

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.