標籤:des style blog http io color ar os 使用
1.把網站添加到案頭:
<a href="shortcut.php">放到案頭上</a><?PHP $Shortcut = "[InternetShortcut] URL=http://www.xxx.com IDList= IconFile=http://www.xxx.com/favicon.ico//表徵圖 IconIndex=1 [{000214A0-0000-0000-C000-000000000046}] Prop3=19,2"; Header("Content-type: application/octet-stream"); header("Content-Disposition: attachment; filename=xxx.url"); echo $Shortcut; ?>
2.設為首頁:
目前這種方法只支援IE核心的瀏覽器
<a target="_self"href="http://www.xxx.com/" onclick="this.style.behavior=‘url(#default#homepage)‘;this.setHomePage(‘http://www.xxx.com/‘);">設為首頁</a>
3.加入收藏:
<a href="javascript:addFavorite();">加入收藏</a><script text="text/javascript"> function addFavorite() { var url = window.location.href; var title = document.title; try { window.external.addFavorite(url, title); } catch (e) { try { window.sidebar.addPanel(title, url, ""); } catch (e) { alert("抱歉,您所使用的瀏覽器無法完成此操作,請使用Ctrl+D進行添加"); } } } </script>
4.下載文檔:
以DOC為例
<?php $filename = "xxxxxx.docx"; header("Cache-Control: public"); header("Content-Description: File Transfer"); header(‘Content-disposition:attachment; filename=‘.basename($filename)); header("Content-Type: application/msword"); //docx或doc格式 header("Content-Transfer-Encoding: binary"); header(‘Content-Length: ‘. filesize($filename)); readfile($filename); ?>
這裡附加一些常用的Content-Type:
‘exe‘ -> ‘application/octet-stream‘
‘pdf‘ -> ‘application/pdf‘,
‘dll‘ -> ‘application/octet-stream‘,
‘pdf‘ -> ‘application/pdf‘,
‘ai‘ -> ‘application/postscript‘,
‘xls‘->‘application/vnd.ms-excel‘, ‘ppt‘ -> ‘application/vnd.ms-powerpoint‘,
‘xml‘ -> ‘text/xml‘,
‘txt‘ -> ‘text/plain‘,
‘jpg‘ -> ‘image/jpeg‘,
‘png‘ -> ‘image/png‘,
‘zip‘ -> ‘application/zip‘,
‘tar‘ -> ‘application/x-tar‘,
‘swf‘ -> ‘application/x-shockwave-flash‘,
PHP網站頭部通欄設計