PHP網站頭部通欄設計

來源:互聯網
上載者:User

標籤: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網站頭部通欄設計

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.