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>
(责任编辑:最模板) |