PHP高手来,简单的问题。

来源:百度知道 编辑:UC知道 时间:2024/07/08 00:47:16
if (HIDEFILEPATHS == TRUE) {
$link = ft_make_link($c['shortname'], 'method=getfile&dir='.rawurlencode($_REQUEST['dir']).'&file='.$c['name'], t('Show !file', array('!file' => $c['name'])));
}

就是怎样让这个链接是在新串口打开? 就像ASP重的 target="_black"

如果你非要在以上代码上修改来使链接在新窗口中打开,我恐怕只有写成如下这样了:
if (HIDEFILEPATHS == TRUE) {
$link = ft_make_link($c['shortname'], 'method=getfile&dir='.rawurlencode($_REQUEST['dir']).'&file='.$c['name'], t('Show !file', array('!file' => $c['name']))) . '" target="_black';
}

因为控制是否在新窗口中打开的部分是在html的A tag里,如:
<a href="http://www.baidu.com" target="_black">百度</a>
我想函数"ft_make_link()"的作用应该只是生成形如上面"http://www.baidu.com"的部分.

echo "<a href = \"$link\" target = \"_blank\">链接名称</a>";