从php中的.lnk文件中提取路径

时间:2017-01-24 07:03:25

标签: php codeigniter symlink

点击shortcut

时,我想重定向到特定路径

如何实现这一目标?

对于ex:TECH.lnk,如果我点击它,它应该重定向到C:\\xampp\\htdocs\\folder\\

这就是我所做的:

   $link =  'TECH.lnk';
   $res = file_get_contents($link);
   echo '<pre>'; print_r($res);

它给了我以下错误:

The connection was reset

1 个答案:

答案 0 :(得分:-1)

<html>
<script type="text/javascript">
    function openFile(file){
        window.open(
            file,
            '_blank' // <- This is what makes it open in a new window.
        );
    }
</script>
<body>
    <a href="#" onclick="javascript:openFile('1.txt')">1 Text</a>
    <a href="#" onclick="javascript:openFile('2.txt')">2 Text</a>
</body>
</html>