: This article describes how to generate a web desktop shortcut using php. For more information about PHP tutorials, see. This article describes how to use php to generate a web desktop shortcut code, add icons, and solve the garbled code problem in different browsers.
When we visit a website, if the content of the website is very attractive, we usually use the favorites function of the browser to add this website to favorites.
To add a webpage to the Favorites folder in a browser, open the browser and select it from the Favorites folder.
If you can directly access the website on the desktop, this will facilitate user access.
You can use php to create a shortcut file for a webpage and save it to your desktop for quick access.
The generated code is as follows:
$ Icon. "";} header ("content-type: application/octet-stream"); // obtain the user's browser $ user_agent =$ _ SERVER ['http _ USER_AGENT ']; $ encode_filename = rawurlencode ($ filename); // different browsers use different encoding to output if (preg_match ("/MSIE/", $ user_agent) {header ('content-disposition: attachment; filename = "'. $ encode_filename. '"');} elseif (preg_match ("/Firefox/", $ user_agent) {header (" content-disposition: attachment; filename * = \ "utf8 ''". $ filen Ame. '"');} else {header ('content-disposition: attachment; filename =" '. $ filename.' "');} echo $ shortCut;}?>
Download and save to desktop
Save to desktop
After saving it as *. url on the desktop, click it to automatically open the browser and access the website content.
The content of the. url file is as follows:
[InternetShortcut]IDList=[{000214A0-0000-0000-C000-000000000046}]Prop3=19,2URL=http://fdipzone.com/Ic>http://fdipzone.com/favicon.ico
'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
'). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script
The above describes how to generate a web desktop shortcut in php, including some content. I hope my friends who are interested in PHP tutorials can help me.