Home > php教程 > php手册 > 用php实现下载生成某链接的快捷方式

用php实现下载生成某链接的快捷方式

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-06 19:52:12
Original
1065 people have browsed it

点击一个页面中的某个按钮或者链接,生成某链接的快捷方式同时下载到本地,如果使用php语言来实现,网上比较多的方法如下: ?php $Shortcut ="[InternetShortcut] URL=http://www.your_url.com/ IconFile=http://www.your_icon.com/ IconIndex=1 IDList= [{0

点击一个页面中的某个按钮或者链接,生成某链接的快捷方式同时下载到本地,如果使用php语言来实现,网上比较多的方法如下:

$Shortcut = "[InternetShortcut]  
URL=http://www.your_url.com/  
IconFile=http://www.your_icon.com/  
IconIndex=1  
IDList=  
[{000214A0-0000-0000-C000-000000000046}]  
Prop3=19,2  
";  
header("Content-type: application/octet-stream");  
header("Content-Disposition: attachment; filename=链接文字.url;");  
echo $Shortcut;  
?>  

但是,IconFile这个图标没有生效;此外,这个是可以支持中文的,如果不支持中文的话,可以加上一行代码:

header('Content-Type: text/html; charset=utf-8');  

将该php文件放到服务器apache上,然后访问即可生成一个链接的快捷方式。
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template