ASP and PHP implements the method of generating web shortcuts and downloading them to the desktop _php tips

Source: Internet
Author: User

Set up on the site "to add favorites, set as the home Page" button is a general site will do things, but some sites also have "put on the desktop" such as the function settings.
The following is the generation of shortcuts and download to the desktop of the PHP implementation code, excerpts modified on the network, only for reference

PHP Implementation code:

Copy Code code 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 Code code as follows:

<%
id = Int (request ("id")
If id= "" Then id= "1"
title = Request ("title")
If title= "" Then title= "cloud-dwelling community"

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


is simple to generate, forcing the content of a URL shortcut to be exported as an attachment, which is downloaded to a custom Web site shortcut when accessed. But the function can be very large, you can set its default icon with the same as my computer, Network Neighborhood, folder, and so on, and because it is a normal shortcut, will not be anti-virus software and other killing, it is often used by some hacker behavior, to bring huge real traffic.

Related Article

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.