Home > Article > Backend Development > ASP and PHP implement methods to generate website shortcuts and download them to the desktop_PHP tutorial
Setting buttons such as "Add to Favorites, Set as Homepage" on a website is something that most websites do, but some websites also have functional settings such as "Put on Desktop".
The following is the PHP implementation code that generates a shortcut and downloads it to the desktop. The excerpt is modified from the Internet and is for reference only
php implementation code:
asp implementation code:
Shortcut = "[DEFAULT]" & vbCrLf
Shortcut = Shortcut & "BASEURL=http://www.jb51.net/?desktop" & vbCrLf
Shortcut = Shortcut & "[{000214A0-0000 -0000-C000-000000000046}]" & vbCrLf
Shortcut = Shortcut & "Prop3=19,2" & vbCrLf
Shortcut = Shortcut & "[InternetShortcut]" & vbCrLf
Shortcut = Shortcut & "URL =http://www.jb51.net/?desktop" & vbCrLf
Shortcut = Shortcut & "IDList=[{000214A0-0000-0000-C000-000000000046}]" & vbCrLf
Shortcut = Shortcut & " IconFile=http://www.jb51.net/favicon.ico" & vbCrLf
Shortcut = Shortcut & "IconIndex=" & id & vbCrLf
Shortcut = Shortcut & "HotKey=0" & vbCrLf
Shortcut = Shortcut & "Prop3=19,2" & vbCrLf
Response.AddHeader "Content-Dispositon", "attachment;filename=" & title & ".url";
Response.ContetType = "application/octet-steam"
Response.Write Shortcut
%>
The generation principle is very simple, that is, the content of the url shortcut is forced to be output as an attachment. When accessed, a customized website shortcut is downloaded. However, this function may be very useful. You can set its default icon to be the same as My Computer, Network Places, folders, etc., and because it is a normal shortcut, it will not be detected by anti-virus software. Therefore, it is often used by some hackers to bring huge real access traffic.