Setting "add to favorites, set as Homepage" and other buttons on a website is common for websites, but some websites also have such functional settings as "put on the desktop.
The following is the php implementation code for generating shortcuts and downloading them to the desktop. The excerpt is modified to the network for reference only.
Php implementation code:
Copy codeThe Code is as follows:
<? Php
If (isset ($ _ GET [title]) & trim ($ _ GET [title])! = "") $ Title = trim ($ _ GET [tilte]);
$ Content ='
[DEFAULT]
BASEURL = http://www.jb51.net /? Desktop
[{000214A0-0000-0000-C000-000000000046}]
Prop3 = 19,2
[InternetShortcut]
URL = http://www.jb51.net /? Desktop
IDList = [{000214A0-0000-0000-C000-000000000046}]
IconFile = http://www.jb51.net/favicon.ico
IconIndex = 1
HotKey = 0
Prop3 = 19,2 ';
Header ("Content-type: application/octet-stream ");
Header ("Content-Disposition: attachment; {$ title}. url ;");
Echo $ content;
?>
Asp implementation code:
Copy codeThe Code is as follows:
<%
Id = int (request ("id "))
If id = "" then id = "1"
Title = request ("title ")
If title = "" then title = ""
Export cut = "[DEFAULT]" & vbCrLf
Export cut = export cut & "BASEURL = http://www.jb51.net /? Desktop "& vbCrLf
Export cut = export cut & "[{000214A0-0000-0000-C000-000000000046}]" & vbCrLf
Export cut = Shortcut & "Prop3 = 19,2" & vbCrLf
Shortcut = Shortcut & "[InternetShortcut]" & vbCrLf
Export cut = export cut & "URL = http://www.jb51.net /? Desktop "& vbCrLf
Export cut = Shortcut & "IDList = [{000214A0-0000-0000-C000-000000000046}]" & vbCrLf
Export cut = export cut & "IconFile = http://www.jb51.net/favicon.ico" & vbCrLf
Export cut = Shortcut & "IconIndex =" & id & vbCrLf
Export cut = Shortcut & "HotKey = 0" & vbCrLf
Export cut = Shortcut & "Prop3 = 19,2" & vbCrLf
Response. AddHeader "Content-Dispositon", "attachment; filename =" & title & ". url ";
Response. ContetType = "application/octet-steam"
Response. Write Shortcut
%>
Its generation principle is very simple. The url Shortcut content is forcibly output as an attachment, and a custom website shortcut is downloaded upon access. However, this function may play a major role. You can set its default icon to be the same as that of my computer, network neighbors, and folders, and it is a normal shortcut, it will not be scanned and killed by antivirus software, so it is often used by some hackers to bring huge real access traffic.