How to add the ICO icon to the code saved to the desktop in PHP with garbled characters?
$ 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 = xx website. url; "); echo $ shortCut;
In UTF8 mode, CHROME downloads are normal. in IE9, a website becomes garbled.
In ANSI format, CHROME downloads a website that has become garbled, and IE9 has not changed to 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 = 'XX 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 = 'XX 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 = Add this parameter to the icon path
IconFile = Add this parameter to the icon path
$ 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 = xx website. url; "); echo $ shortCut;
This is invalid and does not respond.
Use http: //
Use http: //
$ ShortCut = "[InternetShortcut] URL = http://www.xxx.com /? Zuomian2015IconFile = Contents "; Header (" Content-type: application/octet-stream "); header (" Content-Disposition: attachment; filename = xx. url; "); echo $ shortCut;
Still invalid
The method is correct. do you actually display the browser icon?
Let's see it.
IconFile = http://www.vcoo.cc/favicon.ico
The reason is that the icon format is not required.
Reference: http://blog.csdn.net/fdipzone/article/details/50423613
The method is correct. do you actually display the browser icon?
Let's see it.
IconFile = http://www.vcoo.cc/favicon.ico
The reason is that the icon format is not required.
This ico won't work either. the browser icon is displayed, that is, the CHROME icon.
Reference: http://blog.csdn.net/fdipzone/article/details/50423613
Thanks for writing a long article, but the icon still cannot be displayed normally after testing. I wonder if it will be related to the browser or the system.
I don't know.
Here I am
IconFile = http://c.csdnimg.cn/public/favicon.ico doesn't work
IconFile = http://www.vcoo.cc/favicon.ico can
The method is correct. do you actually display the browser icon?
Let's see it.
IconFile = http://www.vcoo.cc/favicon.ico
The reason is that the icon format is not required.
Big Brother, have you retired yet? Happy new year
The cause is found. If your saved website. url is added to favorites. The icon is displayed. Otherwise, the icon cannot be displayed.
Because the icon is read from the browser cache. If this icon is not displayed in the cache, it is not displayed.
For example, if you want to create a Baidu
First, you must add Baidu to your browser.
Then IconFile = Baidu's favicon address