Re: Closing my Window after Download

From: Date: Wed, 01 Sep 2004 12:52:47 +0000
Subject: Re: Closing my Window after Download
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-195385@lists.php.net to get a copy of this message
From: "PHP Junkie" <phpjunkie@mjimm.com>
Which page do you give this code in? For example, I have a page admin.php .... Therein is the link on which, when a user clicks, a window "admin_dl.php" opens. The "admin_dl.php" contains my force-download code and it is that window that I'm trying to close. If I specify this following code in admin.php itself, would it work? Admin.php does contain a lot of other stuff too.
Are we still on this topic? Say for example you request example.org/music.mp3. The file downloads to your computer, right? How is a request for a download of an MP3 file going to close your browser window? Your request for "admin_dl.php" is no different than a direct request for an MP3 file. You can't send a file and then expect to execute some HTML/JS or redirect to another page. Why are you opening another window, anyhow? Just link to admin_dl.php from admin.php. When a user clicks on the link, it'll trigger a download and the user will never leave admin.php. When you click on a link to an MP3, the web page your on doesn't change, does it? I thought this was already explained to everyone? If anyone thinks I'm wrong, I'm more than happy to admit it; just show me how. ---John Holmes...

« previous php.general (#195385) next »