前端之家收集整理的这篇文章主要介绍了
php中网页添加到桌面快捷方式方法,
前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我们经常会在网站中看到可以直接把网站以快捷方式保存到自己的电脑中,然后只要点击就可以实现进入网了,那么PHP中怎么把网页添加到桌面快捷方式呢,用PHP代码来实现有点不可思议,虽然我们可以直接在桌面来实现,但有的时候WEB应用需要用代码来实现。
功能简单,直接上代码:
- $Shortcut = "
- [InternetShortcut]
- URL=http:
- IDList=IconFile=http:
- Prop3=19,2";
- header("Content-Type: application/octet-stream");
- header("Content-Disposition: attachment; filename=PHPfensi.url");
- echo $Shortcut;
下面还提供一种方法,代码如下:
- <?PHP
- $Shortcut = "[InternetShortcut]
- URL=http:
- IDList=
- [{000214A0-0000-0000-C000-000000000046}]
- Prop3=19,2
- ";
- Header("Content-type: application/octet-stream");
- header("Content-Disposition: attachment; filename=11cn.url;");
- echo $Shortcut;
- ?>