• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

ASP和PHP实现生成网站快捷方式并下载到桌面的方法

php 搞代码 4年前 (2022-01-01) 40次浏览 已收录 0个评论

这篇文章主要介绍了PHP实现生成网站快捷方式并下载到桌面的方法,比加入收藏、设为首页更给力哦,需要的朋友可以参考下

在网站上设置“加入收藏、设为首页”等按钮是一般网站都会干的事儿,但来源gaodai#ma#com搞@@代~&码网是有的网站还有“放到桌面”这样的功能设置。
下面即生成快捷方式并下载到桌面的php实现代码,摘录修改于网络,仅作参考

php实现代码:

代码如下:
<?php
if(isset($_GET[title]) && trim($_GET[title]) !== “”) $title = trim($_GET[tilte]);
$content=’
[DEFAULT]
BASEURL=https://www.gaodaima.com/?desktop
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=https://www.gaodaima.com/?desktop
IDList=[{000214A0-0000-0000-C000-000000000046}]
IconFile=https://www.gaodaima.com/favicon.ico
IconIndex=1
HotKey=0
Prop3=19,2′;
header(“Content-type:application/octet-stream”);
header(“Content-Disposition:attachment; {$title}.url;”);
echo $content;
?>

asp实现代码:

代码如下:
<%
id = int(request(“id”))
if id=”” then id=”1″
title = request(“title”)
if title=”” then title=”脚本之家”

Shortcut = “[DEFAULT]” & vbCrLf
Shortcut = Shortcut & “BASEURL=https://www.gaodaima.com/?desktop” & vbCrLf
Shortcut = Shortcut & “[{000214A0-0000-0000-C000-000000000046}]” & vbCrLf
Shortcut = Shortcut & “Prop3=19,2” & vbCrLf
Shortcut = Shortcut & “[InternetShortcut]” & vbCrLf
Shortcut = Shortcut & “URL=https://www.gaodaima.com/?desktop” & vbCrLf
Shortcut = Shortcut & “IDList=[{000214A0-0000-0000-C000-000000000046}]” & vbCrLf
Shortcut = Shortcut & “IconFile=https://www.gaodaima.com/favicon.ico” & vbCrLf
Shortcut = Shortcut & “IconIndex=” & id & vbCrLf
Shortcut = Shortcut & “HotKey=0” & vbCrLf
Shortcut = Shortcut & “Prop3=19,2” & vbCrLf

Response.AddHeader “Content-Dispositon”, “attachment;filename=” & title & “.url”;
Response.ContetType = “application/octet-steam”
Response.Write Shortcut
%>

以上就是ASP和PHP实现生成网站快捷方式并下载到桌面的方法的详细内容,更多请关注gaodaima搞代码网其它相关文章!


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:ASP和PHP实现生成网站快捷方式并下载到桌面的方法
喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址