我们经常会在网站中看到可以直接把网站以快捷方式保存到自己的电脑中,然后只要点击就可以实现进入网了,那么php中怎么把网页添加到桌面快捷方式呢。
功能简单,直接上代码。
代码如下 |
复制代码 |
<a href='shortcuts.php'>火星时代IT开发</a> |
shortcuts.php 代码
代码如下 |
复制代码 |
$Shortcut = " [InternetShortcut] URL=http://www.phprm.com IDList=IconFile=http://www.phprm.com/favicon.ico Prop3=19,2"; header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=111cn.url"); echo $Shortcut; |
下面还提供一种方法
代码如下 |
复制代码 |
<?php $Shortcut = "[InternetShortcut] URL=http://www.phprm.com/ IDList= [{000214A0-0000-0000-C000-000000000046}] Prop3=19,2 "; Header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=11cn.url;"); echo $Shortcut; ?> |
永久链接:http://www.phprm.com/develop/44908.html
转载随意!带上文章地址吧。