if you're not getting any html after your php script, then there's a different problem. I do the same thing and all I use is:
<?php ... ?> <script language="javascript"> <!-- window.close(); //--> </script> and I've never had a problem with it not closing... -- -------------------------------------------------------------->> Jasper Howard :: Database Administration Velocity7 1.530.470.9292 http://www.Velocity7.com/ <<-------------------------------------------------------------- "Php Junkie" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Ave, > > It still doesn't work. Not only that, I put up a "close window" button in > the page and even that doesn't show up. Although that's still not what I > want. What I want is the window to close automatically. > > Here's my page: > > <?php > $file = "$P/$F"; > header("Content-Description: File Transfer"); > header("Content-Type: application/force-download"); > header("Content-Disposition: attachment; filename=".basename($file)); > @readfile($file); > ?> > <html> > <head> > <title>D/L Window</title> > <script language="javascript"> > function close_opener() > { > parentwin = window.self; // Make handle for > current window named "parentwin" > parentwin.opener = window.self; // Tell current window > that it opened itself > parentwin.close(); // Close window's parent > (e.g. the current window) > } > </script> > </head> > <body onLoad="close_opener();"> > <center><form><input type="button" value="Close Window" > onClick="window.close();"></form></center> > </body> > </html> > > I don't know what to do... The page just won't close. > > > > > > > Here, try this JS: > > > > function close_opener() > > { > > parentwin = window.self; // Make handle for > > current window named "parentwin" > > parentwin.opener = window.self; // Tell current window > > that it opened itself > > parentwin.close(); // Close window's > > parent (e.g. the current window) > > } > > > > HTH - Miles Thompson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php