談到使用代碼實現網站快捷方式保存到桌面,我們不得不提下使用PHP代碼的方式實現網站頁面快捷保存到桌面,下面是PHP代碼實現的通用方式:
<?php $Shortcut = "[InternetShortcut] URL=http://www.companysz.com IconFile=http://www.companysz.com/favicon.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=武林網.url"); echo $Shortcut; ?>
以上代碼就是我們經常用到的PHP實現網址快捷保存到桌面的代碼,把上面這段代碼放保存為desk.php在需要的調用直接調用就可以。
<a href="/desk.php">保存到桌面</a>
有興趣的朋友收藏起來,而今天織夢模板網給大家介紹的是帝國CMS專用的將網址快捷方式保存到桌面,使用帝國CMS的用戶可以留心看下。
帝國CMS專用的保持快接鏈接到桌面的代碼:
<?phprequire("e/class/connect.php");$add=$_GET;$id=$add["id"];$gname=$add["gname"];if ($gname==""){$gname=$public_r[sitename];$gname = urldecode($gname);$gname = mb_convert_encoding($gname,'GB2312','UTF-8');}$Shortcut = "[InternetShortcut] URL=http://".$_SERVER['HTTP_HOST']."/?desktop IDList=[{000214A0-0000-0000-C000-000000000046}]Prop3=19,2 "; Header("Content-type: application/octet-stream;");header("Content-Disposition: attachment; filename=".$gname.".url;");echo $Shortcut;?>
使用方法
網站目錄新建一個desk.php文件,復制以上代碼到PHP文件中保存,直接在需要顯示的地方鏈接這個文件就可以了:
<a href="/desk.php">保存到桌面</a>
新聞熱點
疑難解答