Get the App
SLTechnology News&Howtos  ›  Development  › 

How to write php code compatible with ie6 browsers

Shulou Source: shulou.com Published: 2022-06-03 09:15:33 11月15日 Update

This article mainly explains "how to write php code compatible with ie6 browsers". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's ideas to study and learn "how to write php code compatible with ie6 browsers".

$filename = ". /". $_ REQUEST ['name']; / / here is the specific path of Fengge, as long as $filename is the full path to the file you want to download. If (! is_file ($filename)) {/ / check whether the file exists. Die ('the downloaded file seems to have eloped with TM!');} $filepath = str_replace ('\','/', realpath ($filename)); $filesize = filesize ($filepath); $filename = substr (strrchr ('/'. $filepath,'/'), 1); $extension = strtolower (strrchr ($filepath,'.), 1)) / / use this unless you want to find the mime type based on extension, file suffix format, not interpreted. $mime = array ('application/octet-stream'); header (' Content-Type:'. $mime); header ('Content-Disposition: attachment; filename= ". $filename.'"'); header ('Content-Transfer-Encoding: binary'); header (' Content-Length: '.Secrettf ('% dumped, $filesize)); header ('Expires: 0') / / check for IE only headers, stupid IE test, you know .if (isset ($_ SERVER ['HTTP_USER_AGENT']) & & ((strpos ($_ SERVER [' HTTP_USER_AGENT'], 'MSIE')! = = false)) {header (' Cache-Control: must-revalidate, post-check=0, pre-check=0'); header ('Pragma: public');} else {header (' Pragma: no-cache');} $handle = fopen ($filepath, 'rb'); fpassthru ($handle) Fclose ($handle): thank you for reading, the above is the content of "how to write php code compatible with ie6 browsers". After the study of this article, I believe you have a deeper understanding of how to write php code compatible with ie6 browsers, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Tags: Code browser browsing file learning content path detection suffix that is ideas situations articles more formats knowledge knowledge points articles follow questions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft NVidia Huawei Apple Shulou Information