打开php网页直接创建桌面网页快捷方式的php代码

admin
admin
admin
376
文章
102
评论
2021年12月6日23:36:54
评论
119

今天介绍一段php代码,能够实现打开php网页即可在电脑桌面上生成网页快捷方式的功能:

<?php 
$Shortcut = "[InternetShortcut]
URL=https://www.pinzixing.com/;
Prop3=19,2";Header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=品自行博客.url;");
echo $Shortcut;
?>

这里对上述代码进行简单说明一下:

格式说明:header("Content-Disposition: disposition-type; filename=disposition-parm;");

字段说明:Content-Disposition为属性名,content-disposition 一般有两种方式:inline:直接在页面显示,attchment:以附件形式下载

disposition-parm为默认保存时的文件名。

打开php网页直接创建桌面网页快捷方式的php代码

将上述代保存文xxx.php,传到网站后台,在浏览器中打开这个php页面,会提示我们保存文件名“品自行博客.url”的一个快捷方式,我们选择目录下载即可保存。

admin
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: