Home  >  Article  >  Backend Development  >  Example of creating desktop shortcut with PHP_PHP tutorial

Example of creating desktop shortcut with PHP_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:00:191125browse

To use php to create desktop shortcuts, we need to use header, InternetShortcut and some codes that I don’t understand. Let me introduce an example below.


Method: Create a new php file, then throw the following code into it, save it as shortcut.php, and place it on the website and directory

echo $shortCut;
The code is as follows
 代码如下 复制代码


$shortCut = "[InternetShortcut]
URL=http://www.hzhuti.com
IDList=
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
";
Header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=hzhuti.url;");
echo $shortCut;

Copy code


$shortCut = "[InternetShortcut]

URL=http://www.hzhuti.com

IDList=

[{000214A0-0000-0000-C000-000000000046}]

Prop3=19,2

";

Header("Content-type: application/octet-stream"); ​​

header("Content-Disposition: attachment; filename=hzhuti.url;");

Modify the website address (URL) and saved file name (filename) in the code. Note: Do not convert the encoding to UTF-8 when saving. Due to differences in various browsers, some may cause the file name to be garbled when saving. When visiting this page, you are prompted to download the .url file. Saving it locally is a shortcut. Remember to change the URL address of the above code to your own, and change the filename at the end to the name of your website.
http://www.bkjia.com/PHPjc/631249.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631249.htmlTechArticleTo use php to create desktop shortcuts we need to use header, InternetShortcut and some codes that I don’t understand, as follows Let me introduce an example. Method: Create a new php file, then...
Statement:
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