Code to create web page desktop shortcut using php or asp_PHP tutorial

WBOY
Release: 2016-07-21 15:40:02
Original
1176 people have browsed it

Create a new PHP document: the name is easy to remember, such as: shortcut.php
Contents in the PHP document:
Code

Copy code The code is as follows:

$Shortcut = "[InternetShortcut]
URL=http://www.jb51.net/
IDList=
[{000214A0- 0000-0000-C000-000000000046}]
Prop3=19,2
";
Header("Content-type: application/octet-stream"); ​​
header("Content-Disposition: attachment; filename=Script Home.url;");
echo $Shortcut;
?>

If you want the icon to appear, please make sure there is favicon.ico in the root directory of the website. Upload the file
to the website, visit the address: such as: http://www.jb51.net/shortcut.php, you will be prompted to download a file named Script Home.url, and saving it locally is a shortcut!
The following is the asp implementation code:
Copy the code The code is as follows:

<%
id=int( request("id"))
if id="" then id="1"
title=request("title")
If title="" Then title="Script Home"
Shortcut = "[InternetShortcut] " & vbCrLf
Shortcut = Shortcut & "URL=http://www.jb51.net/article/"&id&".htm?desktop" & vbCrLf
Shortcut = Shortcut & " IDList= " & vbCrLf
Shortcut = Shortcut & "[{000214A0-0000-0000-C000-000000000046}] " & vbCrLf
Shortcut = Shortcut & "Prop3=19,2 " & vbCrLf
Shortcut = Shortcut & " " & vbCrLf
Response.AddHeader "Content-Disposition", "attachment;filename="&title&".url;"
Response.ContentType = "application/octet-stream"
Response.Write Shortcut
%>


It should be noted that it may be locked due to possible security issues
You need to do the following, right click on "Script Home.url"--" --》Properties--》You can access it by unlocking it. This requires similar operations just like the chm file downloaded from the Internet.
Code to create web page desktop shortcut using php or asp_PHP tutorial

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/321474.htmlTechArticleCreate a new PHP document: the name is easy to remember, such as: shortcut.php Contents in the PHP document: Code copy code code As follows: ?php $Shortcut = "[InternetShortcut] URL=http://www.jb51.net/ I...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template