Home > php教程 > php手册 > body text

PHP创建桌面快捷方式实例,php快捷方式实例

WBOY
Release: 2016-06-13 09:29:45
Original
2324 people have browsed it

PHP创建桌面快捷方式实例,php快捷方式实例

要利用php创建桌面快捷方式我们需要借助于header,InternetShortcut及一些我看不懂的代码。

方法:新建一个php文件,然后把下面的代码扔进去,保存为比如shortcut.php,放在网站跟目录,代码如下:

<span>$shortCut</span> = "<span>[InternetShortcut]  
URL=http://www.baidu.com  
IDList=  
[{000214A0-0000-0000-C000-000000000046}]  
Prop3=19,2  
</span>"<span>;  
</span><span>Header</span>("Content-type: application/octet-stream"<span>);  
</span><span>header</span>("Content-Disposition: attachment; filename=baidu.url;"<span>);  
</span><span>echo</span> <span>$shortCut</span>; 
Copy after login

 

用PHP写一个下载页面到桌面的快捷方式的代码 网站打开后显示下面问题,问怎解决

你要写一个单独的页面来创建快捷方式,我估计你在这之前就有内容在页面上输出了,所以抱着个错

a.php
----------------------------------
$url = $_GET['url'];
$filename = urldecode($_GET['name']);
$filename = iconv('utf-8','GBk',$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;

生成的时候做个超链接
快捷方式
 

javascript怎创建桌面快捷方式

网上常见的都是调用
WshShell.CreateShortcut但是只有ie支持ActiveXObject对象
所以要想实现只能跑后台 然后传回一个快捷方式
类似下载文件一样
给你找了段php的例子

 

Related labels:
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!