Re: Data download from PHP/MSSQL to Excel

From: Hi Ho (ziad44444_at_hotmail.com)
Date: 04/22/04


Date: Wed, 21 Apr 2004 18:23:01 -0400

This is browser dependant and not PHP

"marty" <marty_elder@adp.com> wrote in message
news:166bf1ae.0404210549.313ad03b@posting.google.com...
> I have a webpage that displays data from a SQL database in table
> format. I found information on how to create a way to allow a user to
> download this information to Excel using 'Header()' in the PHP code.
>
> Header("Content-Type: application/vnd.ms-excel");
> Header("Content-Disposition: attachment;
> filename=\"filename.xls\"");
>
> I setup a link on the display page that sends the variables needed for
> the SQL query to a different PHP page and the link is targeted to a
> bogus target window (target="excel") so that it doesn't change my
> current display. This is meant for people who find the proper display
> they want and then want to save it but also want to continue display
> other data in the current window.
>
> If the user clicks the link it then opens a browser window and prompts
> the user with the typical IE download prompts, which is fine. But if
> the user chooses to 'Save' the file to his/her pc and then goes
> through the steps to save it, the browser window that was opened
> doesn't automatically close. If the user chooses to open the .xls or
> chooses to cancel the download, then the browser window closes just
> fine.
>
> Any suggestions as to how to alleviate this problem?



Relevant Pages

  • Re: Open and process remote page
    ... William Hudson wrote: ... I have toyed with some of the php functions for opening URLs, ... > I need to fully emulate a browser, ... > display the remote page). ...
    (comp.lang.php)
  • Re: 800x600
    ... >>> browser window shrinks you end up with a photo with one word per ... So if you want to display images at a size ...
    (uk.net.web.authoring)
  • Re: 800x600
    ... >> larger browser window and a lot of the space is then blank. ... > display your page. ... Size), images cannot. ...
    (uk.net.web.authoring)
  • Re: Function execution before page reload
    ... concepts with PHP as well as OOP so bare with me... ... I put two 'if' statements to check the form and then displayed the contents what was queried from the browser! ... Yep, basically before you write your page, you have your PHP code check the $_POST array to see if data has been sent. ... process the data and then display the page. ...
    (comp.lang.php)
  • Re: Open and process remote page
    ... contents and then display that page as if they had typed the URL into a browser. ... I have toyed with some of the php functions for opening URLs, but what I am not clear on is how much work my script will have to do (do I need to fully emulate a browser, for example). ... The net effect I am after is very similar to the page translation feature ...
    (comp.lang.php)