我们知道,能让访客保存你的网站网址到他桌面,那将大大提高用户粘度和网站的回访率。
输出URL的快捷方式的实现方法有很多,在本文将为大家介绍下使用php是如何实现的,感兴趣的朋友可以参考下,希望对大家有所帮助。

<?php
$shortcut = ‘[InternetShortcut]
URL=http://www.4u4v.cn
IconFile=http://www.4u4v.cn/favicon.ico
IconIndex=1
HotKey=10000
IDList=
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
‘;
$ua = $_SERVER[“HTTP_USER_AGENT”];
$filename = “水木轩(4u4v.cn).url”;
$encoded_filename = urlencode($filename);
$encoded_filename = str_replace(“+”, “%20”, $encoded_filename);
header(‘Content-Type: application/octet-stream’);
if(preg_match(“/MSIE/”, $ua)){
header(‘Content-Disposition: attachment; filename=”‘.$encoded_filename.'”‘);
}else if(preg_match(“/Firefox/”, $ua)){
header(‘Content-Disposition: attachment; filename*=”utf8\’\”.$filename.'”‘);
}else{
header(‘Content-Disposition: attachment; filename=”‘.$filename.'”‘);
}
echo $Shortcut;
?>

最直接的办法:在自己的电脑上创建了一个包含网址的快捷方式,就可以上传到网站空间供访客下载。