PHP File going to Microsoft Excel “The file is corrupt and cannot be opened” [solved]

Encoutered this issue with a website I was working on. When i convert the data to excel it comes out with message “The file is currpt and cannot be opened”.

When I tried to do research I found a page that says you open the file using notepad and then save it. Once done, you can open it normally.

To my end I was able to solve it by moving the access codes (user , password , database) of the mysql to the actual page itself. Usually I reference it from another php page. But this time, moving it solved my problem

Hope this helps somebody out there

Coffee Cup

Leave a Reply

Your email address will not be published. Required fields are marked *