Practices in windows
The code is as follows: |
Copy code |
[InternetShortcut] URL = http://www.111cn.net/ Modified = 704A92F76804CA017A IconIndex = 137 IconFile = C: WINDOWSsystem32SHELL32. dll HotKey = 0 IDList = [InternetShortcut. A] [InternetShortcut. W] [{000214A0-0000-0000-C000-000000000046}] Prop3 = 19,2 |
Save the following code as a shortcut cut. Php file. Click the link to download the website icon shortcut to the desktop.
The ico icon may not be displayed in different systems. Please try the following code:
XML/HTML code
The code is as follows: |
Copy code |
1. [DEFAULT] 2. BASEURL = http://www.111cn.net/ 3. [InternetShortcut] 4. URL = http://www.111cn.net/#shortcut 5. Modified = 70BF4B88E372CC0124 6. IconFile = http://www.111cn.net//faviconbig.ico 7. IconIndex = 1 |
The above code
If urlencode is not used in, the obtained Chinese file name will be garbled, and urldecode must be used in Firefox. Using urlencode will also cause garbled file names, I will try again later. I used the following method to judge the browser type and used different methods to solve the garbled problem.
The code is as follows: |
Copy code |
<? Php $ Browser = strtolower (browser ()); $ Filename = 'Notes for php programmers '; If ($ browser = 'Firefox '){ $ Filename = urldecode ($ filename ); } Else { $ Filename = urlencode ($ filename ); } $ Url = 'http: // www.phpernote.com /'; $ Shortcuts = '[InternetShortcut] URL = '. $ url .' IDList = [{000214A0-0000-0000-C000-000000000046}] Prop3 = 19,2 '; Header ('content-type: application/octet-stream '); Header ('content-Disposition: attachment; filename = '. $ filename.'. url ;'); Echo $ Shortcuts; Function browser (){ $ User_agent = $ _ SERVER ['http _ USER_AGENT ']; If (false! = Strpos ($ user_agent, 'msie 9.0 ')){ Return 'ie9 '; } If (false! = Strpos ($ user_agent, 'msie 8.0 ')){ Return 'ie8 '; } If (false! = Strpos ($ user_agent, 'msie 7.0 ')){ Return 'ie7 '; } If (false! = Strpos ($ user_agent, 'msie 6.0 ')){ Return 'ie6 '; } If (false! = Strpos ($ user_agent, 'Firefox ')){ Return 'Firefox '; } If (false! = Strpos ($ user_agent, 'Chrome ')){ Return 'Chrome '; } If (false! = Strpos ($ user_agent, 'Safari ')){ Return 'Safari '; } If (false! = Strpos ($ user_agent, 'Opera ')){ Return 'Opera '; } If (false! = Strpos ($ user_agent, '360se ')){ Return '360se '; } } |