Forum Moderators: coopster

Message Too Old, No Replies

After fwrite to a file can the new file be loaded in curr. browser window?

         

cward quickshift

3:40 pm on Nov 9, 2005 (gmt 0)

10+ Year Member



Assuming that I successfully use fopen("$filetoget", "wb"); to open a file, then write stuff out to the file using fwrite($outputfile, $data); and close the new file using fclose($outputfile);

Is it possible for the current PHP script to load the new file (or another webpage, etc) over the top of itself into the browser window in which the PHP script is currently running?

And assuming that there is a way to load the new file into the window, can it be opened in such a way that any embedded php code in the output is executed as th enew page is loaded?

Many thanks!
Christie

sned

5:11 pm on Nov 9, 2005 (gmt 0)

10+ Year Member



If there's no kind of output before you do the file creation, you could do something like:

if(successful file write){
header('Location: new_file_name.php');
}

I think as long as the server thinks that the new file is a php file of sorts, it will parse whatever php input is there.

-sned