Jump to content

validation and forced load


zszucs

Recommended Posts

I'd like to see if there's a better way of doing this.

Right now, i have a form that has some selection criteria and posts to it itself to validate.  If it's good, a link to a forced download that consists of an xls file that has the processed details is presented.  what i would like is to have it post to itself, validate and just force the download if it's good data all there on the same form.  The problem seems to be that there can't be code above the header calls that force the download or the data will just be sent to the browser thus ruining the download.  Is there any way around this to acheive what I'm looking for which is a little more user friendly?

Link to comment
https://forums.phpfreaks.com/topic/129954-validation-and-forced-load/
Share on other sites

As long as no content or other headers are output to the browser by the code, you can output the download headers and the file content on the same page.

this is a full html/php page so there's content there. by the sounds of it i can't do it.  i tried to redirect to the download and then back to the form but when it comes back to the form, that page never finishes rendering

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.