{"id":516,"date":"2024-12-25T15:16:08","date_gmt":"2024-12-25T15:16:08","guid":{"rendered":"http:\/\/basicwebsitesolutions.com\/blog\/?p=516"},"modified":"2024-12-25T15:16:08","modified_gmt":"2024-12-25T15:16:08","slug":"php-file-going-to-microsoft-excel-the-file-is-corrupt-and-cannot-be-opened-solved","status":"publish","type":"post","link":"https:\/\/basicwebsitesolutions.com\/blog\/2024\/12\/25\/php-file-going-to-microsoft-excel-the-file-is-corrupt-and-cannot-be-opened-solved\/","title":{"rendered":"PHP File going to Microsoft Excel \u201cThe file is corrupt and cannot be opened\u201d [solved]"},"content":{"rendered":"\n<p>Encoutered this issue with a website I was working on. When i convert the data to excel it comes out with message &#8220;The file is currpt and cannot be opened&#8221;.<\/p>\n\n\n\n<p>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.<\/p>\n\n\n\n<p>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<\/p>\n\n\n\n<p>Hope this helps somebody out there<\/p>\n\n\n\n<p>Coffee Cup<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Encoutered this issue with a website I was working on. When i convert the data to excel it comes out with message &#8220;The file is currpt and cannot be opened&#8221;. 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 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/basicwebsitesolutions.com\/blog\/2024\/12\/25\/php-file-going-to-microsoft-excel-the-file-is-corrupt-and-cannot-be-opened-solved\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;PHP File going to Microsoft Excel \u201cThe file is corrupt and cannot be opened\u201d [solved]&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,1,11],"tags":[130,77,254,42,8],"class_list":["post-516","post","type-post","status-publish","format-standard","hentry","category-day-to-day-life","category-life-as-a-programmer","category-php-and-mysql","tag-bootstrap","tag-excel","tag-mysql","tag-php","tag-website"],"_links":{"self":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/516","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=516"}],"version-history":[{"count":1,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/516\/revisions"}],"predecessor-version":[{"id":517,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/posts\/516\/revisions\/517"}],"wp:attachment":[{"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=516"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=516"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/basicwebsitesolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=516"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}