|
Posted by NC on 01/25/06 06:02
Dips (nospam) wrote:
>
> I have a program that uses PHP to save and read data from a text file on a
> webserver. When I lauch the program (from a menuing system) the data is
> read in. A sample file would look something like this:
>
> 01/23/06 --data started
> --date completed
> 01/23/06 --last acccess
> 5658.12536 --timeontask
> 15 --last page
>
> While in the program some of these values will change, and when the program
> is exited, the new values will be saved back to the text file. The program
> saves the data in the textfile correctly and the file when viewed through IE
> shows this (which are the updated values):
>
> 01/23/06
> 01/24/06
> 01/24/06
> 74548.0458
> 29
>
> The problem happens when I try to read in the file back in the menuing
> system to see if the assignment is complete (the second line has a value).
> The menuing system is reading in the original data and not the updated data,
> like the old data file is being stored in a cache. If i completly close out
> the program which is embedded in an IE window, and then I relaunch the
> program, the updated data will be read in.
Most likely, the IE simply uses the cached version of the page
generated earlier. You can (theoretically, anyway) instruct browsers
not to cache by sending "Cache-control:" and "Expires:" headers.
Examples of their use can be found in the PHP Manual:
http://www.php.net/header
Cheers,
NC
[Back to original message]
|