服务报价 | 域名主机 | 网络营销 | 软件工具| [加入收藏]
 热线电话: #
当前位置: 主页 > php教程 > php教程 >

php将当前网页创建为桌面快捷方式

时间:2015-07-21 23:49来源:未知 作者:最模板 点击:
php将当前网页创建为桌面快捷方式,创建快捷方式php代码 shortcut.php ?php $Shortcut = [InternetShortcut] URL=//www.zuimoban.com IDList= [{000214A0-0000-0000-C000-000000000046}] Prop3=19,2 ; $ua = $_SERVER[HTTP_USER_AG
php将当前网页创建为桌面快捷方式,创建快捷方式php代码 shortcut.php
 
<?php
$Shortcut = "[InternetShortcut]
URL=//www.zuimoban.com
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="'.$filename.'"');
}else if(preg_match("/Firefox/", $ua)){
    header('Content-Disposition: attachment; filename*="utf8\'\''.$filename.'"');
}else{
    header('Content-Disposition: attachment; filename="'.$filename.'"');
}
echo $Shortcut;
?>
 
在当前页面加入创建快捷方式的超链接
 
<div>
<a href="shortcut.php" target="_blank"><img src="//www.zuimoban.com/templets/default/images/logo.jpg" alt="添加到收藏夹">
</a>
</div>
(责任编辑:最模板)
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
栏目列表
热点内容