I have a program that runs on a regular basis - let's call it process.php It that program I have the following code that counts the number of times the program has run:
/* Turn Counter */
$fp=fopen($turn_ctr,r);
$turn=fgets($fp,999);
fclose($fp);
$fp=fopen($turn_ctr,w);
$new_turn=$turn+1;
/* include('user_l.php'); */
fputs($fp, $new_turn);
fclose($fp);
echo $new_turn;
This code works, but I would like to be able to access the turn number ($new_turn) in another program - let's say in user_l.php I tried to use the include statement that's remarked out but it loads a copy of the output of user_l.php to the screen. I want to be able to actually code the $new_turn variable into user_l.php and get the current value (without having to open the file...) Any ideas? (Sorry if this is way easy, I'm new.)