PHP头条
热点:

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


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

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

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

 


用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;

生成的时候做个超链接
<a href="a.php?url=网页地址&name=快捷方式名称">快捷方式</a>
 

javascript怎创建桌面快捷方式

网上常见的都是调用
WshShell.CreateShortcut但是只有ie支持ActiveXObject对象
所以要想实现只能跑后台 然后传回一个快捷方式
类似下载文件一样
给你找了段php的例子
<?php $Shortcut = "[InternetShortcut] URL=xxxxIconFile=xxx.ico IconIndex=0 HotKey=1613 IDList= [{000214A0-0000-0000-C000-000000000046}] Prop3=19,2"; header("Content-Type: application/octet-stream"); header("Content-Disposition: attachment; filename=xxxx.url"); echo $Shortcut; ?>
 

www.phpzy.comtrue/php/11886.htmlTechArticlePHP创建桌面快捷方式实例,php快捷方式实例 要利用php创建桌面快捷方式我们需要借助于header,InternetShortcut及一些我看不懂的代码。 方法: 新建一个php文件,然后把下面的代码扔进去,保存...

相关文章

相关频道:

PHP之友评论

今天推荐