很多时候我们都的网站需要一个生成快捷方式到桌面的功能,方便用户下次访问我们的网站,但是这个应该怎么生成呢?下面一起来看看吧!
PHP方法:
<?php //网站生成快捷方式功能 $url = 'http://www.haoshu888.com'; $filename = '浩叔逛逛'; if (!$url || !$filename) exit(); $Shortcut = "[InternetShortcut] URL={$url} IDList= [{000214A0-0000-0000-C000-000000000046}] Prop3=19,2"; header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename={$filename}.url;"); echo $Shortcut; ?>
说明:把这段代码放在一个php文件里(例如shortcut.php),然后在你的网站相应的位置写一个超链接,例如:
<a href="shortcut.php" target="_blank">放到桌面</a>
另外,$url和$filename可以根据自己的实际情况修改!
转载请注明: haoshu发表于浩叔逛逛>>https://www.haoshu888.com/php/225.html