php 保存网站快捷方式到桌面的php代码
保存网站快捷方式到桌面的php代码 [代码片段(22行)]
<?php $Shortcut = "[InternetShortcut] URL=http://www.CpdeSnippet.cn IDList= [{000214A0-0000-0000-C000-000000000046}] Prop3=19,2 "; $ua = $_SERVER["HTTP_USER_AGENT"]; $filename = "代码片段.url"; $encoded_filename = urlencode($filename); $encoded_filename = str_replace("+", "%20", $encoded_filename); header('Content-Type: application/octet-stream'); if(preg_match("/MSIE/", $ua)){ header('Content-Disposition: attachment; filename="'.$encoded_filename.'"'); }else if(preg_match("/Firefox/", $ua)){ header('Content-Disposition: attachment; filename*="utf8\\'\\''.$filename.'"'); }else{ header('Content-Disposition: attachment; filename="'.$filename.'"'); } echo $Shortcut; ?> //该片段来自于http://outofmemory.cn
精彩图集
精彩文章