龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > php编程 >

php 保存网站快捷方式到桌面的php代码

时间:2014-08-12 03:25来源:网络整理 作者:网络 点击:
分享到:
保存网站快捷方式到桌面的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
精彩图集

赞助商链接