Code to create desktop shortcuts to web pages using PHP or asp

  • 2020-03-31 20:26:58
  • OfStack

Create a new PHP document: shortcut to remember my name
The contents of the PHP documentation:
code
 
<?php 
$Shortcut = "[InternetShortcut] 
URL=//www.jb51.net/ 
IDList= 
[{000214A0-0000-0000-C000-000000000046}] 
Prop3=19,2 
"; 
Header("Content-type: application/octet-stream"); 
header("Content-Disposition: attachment; filename= The home of the script .url;"); 
echo $Shortcut; 
?> 

Make sure you have the favicon.ico file at the root of your site before the icon appears
Uploaded to the site, access to the address: such as: / / www.jb51.net/shortcut.php will be prompted to download a named this site. The url files, stored in the local is a shortcut!
The following is the asp implementation code:

<% 
id=int(request("id")) 
if id="" then id="1" 
title=request("title") 
If title="" Then title=" The home of the script " 
Shortcut = "[InternetShortcut] " & vbCrLf 
Shortcut = Shortcut & "URL=//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 is important to note that security issues may cause locking
Need the following operation, in the "this site. Url "--" right - "property -" unlock access, this is like the CHM file downloaded on the Internet need similar operation.
< img border = 0 SRC = "http://files.jb51.net/upload/2010-3/20100323143322895.gif" border = 0 >  

Related articles: