PHP saved to the desktop code, how to add ico icon and garbled problem?

Source: Internet
Author: User
$shortCut = "[internetshortcut]url=http://www.xxx.com/?zuomian2015idlist=[{000214a0-0000-0000-c000-000000000046} ]prop3=19,2 "; Header ("Content-type:application/octet-stream"); header ("Content-disposition:attachment; filename= website. url; "); Echo $shortCut;


Save as UTF8 mode, chrome download is normal, IE9 a website to become garbled
Save as ANSI format, chrome download a website to become garbled, IE9 and not become normal


Reply to discussion (solution)

$shortCut = "[internetshortcut]url=http://www.xxx.com/?zuomian2015idlist=[{000214a0-0000-0000-c000-000000000046} ]prop3=19,2 "; Header ("Content-type:application/octet-stream"); $filename = ' website. URL '; $user _agent = $_server[' http_user_agent '];$ Encode_filename = Rawurlencode ($filename), if (Preg_match ("/msie/", $user _agent)) {header (' Content-disposition: Attachment Filename= "'. $encode _filename. ');} else if (Preg_match ("/firefox/", $user _agent)) {header ("content-disposition:attachment; Filename*=\ "UTF8" ". $filename. ' ');} Else{header (' content-disposition:attachment; filename= "'. $filename. '");} Echo $shortCut;

$shortCut = "[internetshortcut]url=http://www.xxx.com/?zuomian2015idlist=[{000214a0-0000-0000-c000-000000000046} ]prop3=19,2 "; Header ("Content-type:application/octet-stream"); $filename = ' website. URL '; $user _agent = $_server[' http_user_agent '];$ Encode_filename = Rawurlencode ($filename), if (Preg_match ("/msie/", $user _agent)) {header (' Content-disposition: Attachment Filename= "'. $encode _filename. ');} else if (Preg_match ("/firefox/", $user _agent)) {header ("content-disposition:attachment; Filename*=\ "UTF8" ". $filename. ' ');} Else{header (' content-disposition:attachment; filename= "'. $filename. '");} Echo $shortCut;



Can I add an ico icon?

iconfile= icon path plus this parameter

iconfile= icon path plus this parameter


$shortCut = "[internetshortcut]url=http://www.xxx.com/?zuomian2015iconfile=/favicon.icoidlist=[{ 000214a0-0000-0000-c000-000000000046}]prop3=19,2 "; Header ("Content-type:application/octet-stream"); header ("Content-disposition:attachment; filename= website. url; "); Echo $shortCut;



This is not working, not responding.

To use HTTP.

To use HTTP.


$shortCut = "[internetshortcut]url=http://www.xxx.com/?zuomian2015iconfile=http://c.csdnimg.cn/public/ favicon.icoidlist=[{000214a0-0000-0000-c000-000000000046}]prop3=19,2 "; Header ("Content-type:application/octet-stream"); header ("Content-disposition:attachment; filename=. url; "); Echo $shortCut;


It's still invalid.

The notation itself is correct, you now actually display the icon is the browser icon it?

You change it to look like this.
Iconfile=http://www.vcoo.cc/favicon.ico

Because the icon format is not required

Reference: http://blog.csdn.net/fdipzone/article/details/50423613

The notation itself is correct, you now actually display the icon is the browser icon it?

You change it to look like this.
Iconfile=http://www.vcoo.cc/favicon.ico

Because the icon format is not required



The same as the ICO, or the browser icon is displayed, is the chrome icon

Reference: http://blog.csdn.net/fdipzone/article/details/50423613



Thank you for writing a long text, but the test is not normal display icons, do not know whether it will be related to the browser and the system

Then I don't know.
In my Place
Iconfile=http://c.csdnimg.cn/public/favicon.ico, No.
Iconfile=http://www.vcoo.cc/favicon.ico can

The notation itself is correct, you now actually display the icon is the browser icon it?

You change it to look like this.
Iconfile=http://www.vcoo.cc/favicon.ico

Because the icon format is not required



Auntie, you haven't retired yet? Happy New Year, huh?

Find out why. If you save the site, the URL is collected in the Favorites folder. The icon is displayed, or the icon cannot be displayed.

Because that icon is read in the browser cache. If the icon does not appear in the cache, it is not displayed.

For example, you want to do a Baidu
Then first to collect Baidu in the browser.

Then iconfile= Baidu's Favicon address

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    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.