新闻动态

news

php生成桌面快捷方式

发表于:2011-08-05 00:00:00 来源:SOUAB.COM 人气:3185

示例代码:

PHP代码
  1. <?php   
  2. $url_this =  "http://".$_SERVER ['HTTP_HOST'].$_SERVER['PHP_SELF'];   
  3. /*echo $url_this;*/  
  4. //第一种。获取当前URL生成。   
  5. $Shortcut = "[InternetShortcut]  
  6. URL={$url_this}  
  7. IDList=  
  8. IconFile=http://www.souab.com/favicon.ico  
  9. IconIndex=1  
  10. [{000214A0-0000-0000-C000-000000000046}]  
  11. Prop3=19,2  
  12. ";   
  13. Header("Content-type: application/octet-stream");    
  14. header("Content-Disposition: attachment; filename=不懂戀愛魚兒.url;");    
  15. echo $Shortcut;   
  16. ?>  
PHP代码
  1. <?php   
  2. //第二种。固定网址生成   
  3. $Shortcut = "[InternetShortcut]  
  4. URL=http://www.souab.com  
  5. IDList=  
  6. IconFile=http://www.souab.com/favicon.ico  
  7. IconIndex=1  
  8. [{000214A0-0000-0000-C000-000000000046}]  
  9. Prop3=19,2  
  10. ";   
  11. Header("Content-type: application/octet-stream");    
  12. header("Content-Disposition: attachment; filename=不懂戀愛魚兒.url;");    
  13. echo $Shortcut;    
  14. ?>