I've just finished a script (with some input from this forum--thanks!) that forces a download on the user's computer.
After the download prompt is delivered, the mySQL database is updated.
The user hits OK to download the file. The dialogue box goes away, and they are back at (still at) the page where they clicked the form button. I should note that the form calls a different file, i.e., the user is on page1.php; the form action is page2.php.
The problem is that the information on page1.php is now out-of-date (because the db has been updated by page2.php).
I want page2.php to force page1.php to refresh.
I tried something like this:
Code: Select all
//this is page2.php
header('Content-type: text/htm') ;
header("Content-Disposition: attachment; filename=\"$filename\"") ;
readfile("./files/$filename") ;
header('Location: http://www.example.com/page1.php') ;
die() ;Thanks!