ASP and PHP are used to generate website shortcuts and download them to the desktop.

Source: Internet
Author: User
This article mainly introduces how PHP can generate website shortcuts and download them to the desktop, which is more powerful than adding them to favorites and setting them as the homepage. For more information, see

This article mainly introduces how PHP can generate website shortcuts and download them to the desktop, which is more powerful than adding them to favorites and setting them as the homepage. For more information, see

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:

The Code is as follows:


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:

The Code is as follows:


<%
Id = int (request ("id "))
If then
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.