PHP生成快捷方式


<?php
$Shortcut = "[InternetShortcut]
URL=http://www.markdream.com
IDList=
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
";
$ua = $_SERVER["HTTP_USER_AGENT"];
$filename = "MarkDream.url";
$encoded_filename = urlencode($filename);
$encoded_filename = str_replace("+", "%20", $encoded_filename);
header('Content-Type: application/octet-stream');
if(preg_match("/MSIE/", $ua)){
    header('Content-Disposition: attachment; filename="'.$encoded_filename.'"');
}else if(preg_match("/Firefox/", $ua)){
    header('Content-Disposition: attachment; filename*="utf8\'\''.$filename.'"');
}else{
    header('Content-Disposition: attachment; filename="'.$filename.'"');
}
echo $Shortcut;

转载:http://www.bingfengsa.com/?p=6


发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

评论审核已启用。您的评论可能需要一段时间后才能被显示。