Results 1 to 14 of 14
  1. #1
    Join Date
    Oct 2004
    Location
    Paris, FRANCE
    Posts
    132

    Post Unanswered: Launching a php script brings up download popup

    Hello

    From my Firefox I try run a php script (say script.php) and,
    depending on the params put on the form,
    I get a download box proposing to me to get
    the file script.php.

    I can see that the file is really interpreted because
    the MySQL queries appear on my monitor.

    Is it a know problem ? I can't find any topic on that
    because I don't know the good keywords.

    I use php4.3.11 through Apache2.

    Thanks for the help.

  2. #2
    Join Date
    Mar 2007
    Posts
    24
    The only thing I can think of is PHP is not installed on your web server correctly. If it is correctly installed, PHP files will be processed by PHP before being returned to the browser, and the browser will believe it's receiving a HTML file, which does not ask you to download it.

  3. #3
    Join Date
    Oct 2004
    Location
    Paris, FRANCE
    Posts
    132
    The thing is that it apears intermittently.

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    now that is odd..
    are you certain the scripts all have the same extension
    are there any extraneuous characters in the file extension
    are the rogue scripts all running on the same server
    is it the same script, or any script

    like Fumigator, the only reason I can think why you will get a download is if the server isn't properly configured for PHP
    I'd rather be riding on the Tiger 800 or the Norton

  5. #5
    Join Date
    Oct 2004
    Location
    Paris, FRANCE
    Posts
    132
    Quote Originally Posted by healdem
    now that is odd..
    Indeed
    Quote Originally Posted by healdem
    are you certain the scripts all have the same extension
    are there any extraneuous characters in the file extension
    are the rogue scripts all running on the same server
    is it the same script, or any script
    Yes it always the same script
    Quote Originally Posted by healdem
    like Fumigator, the only reason I can think why you will get a download is if the server isn't properly configured for PHP
    I was thinking that it could be depending on the size of data to be transfered to the client or because of an error of execution not caught by php.
    By the way, in Firefox it brings the download box but in IE "the page can't (even) be displayed"

  6. #6
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if some php scripts from the same server are working and one isn't then Id check how that script is invoked/called. some scripts working formt eh same server indicates that apache is OK

    if you have type the URL does the script work or does it respond in an identical way to being called from another page.
    I'd rather be riding on the Tiger 800 or the Norton

  7. #7
    Join Date
    Oct 2004
    Location
    Paris, FRANCE
    Posts
    132
    In fact it happens only when I post some values from a <form>.
    Actually I think that the error is repeatable
    but I just wanted to know if this meant something to you.

  8. #8
    Join Date
    Mar 2007
    Posts
    24
    Are you messing with headers in your script?

  9. #9
    Join Date
    Oct 2004
    Location
    Paris, FRANCE
    Posts
    132
    I have put this:

    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    	<meta http-equiv="content-type" content="text/html; charset=utf-8" />

  10. #10
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    How has your PHP been installed with Apache? Built-in or modular?

  11. #11
    Join Date
    Oct 2004
    Location
    Paris, FRANCE
    Posts
    132
    Modular under RedHat.

  12. #12
    Join Date
    Oct 2004
    Location
    Paris, FRANCE
    Posts
    132
    Little info:
    In this script I generate an excel file.
    I have just noticed that it doesn't bring the dialog box
    when I disable the excel generation.

    Actually my script displays a big table of data in HTML
    with a link to download the excel (generated on the fly
    with the document, which is not a good idea I think,
    but I dont know how to generate it afterwards, if
    someone have an idea, it will be welcome).

  13. #13
    Join Date
    Mar 2007
    Location
    636f6d7075746572
    Posts
    770
    How are you generating this excel file? Are you using the PEAR excel creation facility?

  14. #14
    Join Date
    Oct 2004
    Location
    Paris, FRANCE
    Posts
    132
    I am using the version of Spreadsheet-WriteExcel
    just before it was ported to PEAR.
    I found the problem:
    I made a dirty function that converted standard x/y coordinates to Excel one,
    I didn't pay attention manage more than 26 columns,
    My script was occasionnaly generating an Excel of more than 26 cols,
    That was generating formulas with invalid coordinates,
    There was nothing reported in the log,
    Apparently the script was simply crashing without explanation.
    Now I have corrected my dirty function.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •