PHP Create desktop Shortcut instance, php shortcut instance _php Tutorial

Source: Internet
Author: User

PHP Create desktop Shortcut instance, php shortcut instance


To create desktop shortcuts with PHP we need to use Header,internetshortcut and some code that I can't read.

method: Create a new PHP file, and then throw the following code in, save for example shortcut.php, put on the site and directory, the code is as follows:

$shortCut = "[internetshortcut]  url=http://www.baidu.com  idlist=  [{ 000214a0-0000-0000-c000-000000000046}]  prop3=19,2  ";   Header ("Content-type:application/octet-stream");   Header ("Content-disposition:attachment; Filename=baidu.url; " );   Echo $shortCut


Use PHP to write a download page to the desktop shortcut code site after the display of the following questions, ask how to solve

You have to write a separate page to create the shortcut, I guess you have the content on the page before this, so hold a wrong

a.php
----------------------------------
$url = $_get[' url '];
$filename = UrlDecode ($_get[' name ');
$filename = Iconv (' utf-8 ', ' GBk ', $filename);//Character Set conversion
if (! $url | |! $filename) exit ();
$Shortcut = "[Internetshortcut]
url={$url}
idlist=
[{000214a0-0000-0000-c000-000000000046}]
prop3=19,2
";
Header ("Content-type:application/octet-stream");
Header ("content-disposition:attachment; filename={$filename}.url; ");
Echo $Shortcut;

Make a hyperlink at the time of generation
Shortcuts </a>

How JavaScript creates desktop shortcuts

Common on the web is called
Wshshell.createshortcut but only IE supports ActiveXObject objects
So you can only run backstage and return a shortcut to the implementation.
Similar to downloading files
I got you an example of PHP.


http://www.bkjia.com/PHPjc/831620.html www.bkjia.com true http://www.bkjia.com/PHPjc/831620.html techarticle PHP Create desktop Shortcut instances, PHP shortcut instances to use PHP to create desktop shortcuts we need to rely on header,internetshortcut and some of the code I do not understand. Method: New ...

  • 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.