a.php文件
<?php
在新窗口中打开"百度";
在新窗口中打开"hao123";
echo “OK”;
?>
请问怎么弄?
éè¦å¨æ¬æºæ建æå¡å¨ç¯å¢ï¼
1.è¿å ¥ç¾åº¦è½¯ä»¶ä¸å¿ä¸è½½âWampServerâ
2.软件å°åï¼http://rj.baidu.com/soft/detail/10636.html
3.é»è®¤å®è£
4.å®è£ å®æ以åå°phpæ件åæ¾äºC:\wamp\www
5.æµè§å¨ä¸è¾å ¥ç½ålocalhost/ä½ çphpæ件å.php
6.å³å¯é¢è§PHPç½é¡µæ件
1.è¿å ¥ç¾åº¦è½¯ä»¶ä¸å¿ä¸è½½âWampServerâ
2.软件å°åï¼http://rj.baidu.com/soft/detail/10636.html
3.é»è®¤å®è£
4.å®è£ å®æ以åå°phpæ件åæ¾äºC:\wamp\www
5.æµè§å¨ä¸è¾å ¥ç½ålocalhost/ä½ çphpæ件å.php
6.å³å¯é¢è§PHPç½é¡µæ件
温馨提示:答案为网友推荐,仅供参考
第1个回答 2013-05-22
<?php
echo "<a href='' target='_blank'>新窗口中打开hao123</a>";
?>
echo "<a href='' target='_blank'>新窗口中打开hao123</a>";
?>
第2个回答 推荐于2016-02-02
echo <<<_html
<html>
<body onload="document.getElementById('form1').submit();document.getElementById('form2').submit()">
<div style="display: none;">
<form id="form1" target="_blank" action="百度"></form>
<form id="form2" target="_blank" action="hao123"></form>
</div>
</body>
</html>
_html;
<html>
<body onload="document.getElementById('form1').submit();document.getElementById('form2').submit()">
<div style="display: none;">
<form id="form1" target="_blank" action="百度"></form>
<form id="form2" target="_blank" action="hao123"></form>
</div>
</body>
</html>
_html;
特别提示一下,最后一行的_html;必须顶头,前面不能有空格或者制表符
追问第一行和最后一行不要也可以啊?还有就是谷歌浏览器只能弹出hao123,有没有兼容的办法?
追答两个target改成不同的字符就行了吧,比如第一个target="_blank1"第二个target="_blank2"
追问不行啊?
追答测试了一下,确实不行。我这边一个都打不开,全都阻止了,呵呵。那就没办法了,而且估计其它浏览器早晚也会阻止的。你这种行为属于恶意弹窗,被阻止是很正常的。
当一个网页打开,或关闭的同时所有试图弹出窗口的行为都属于恶意弹窗。因为对于正常的应用来说,页面应该已链接的形式显示,当用户点击的时候才去弹出它。
比如你这种,弹两个还好,要是你一次弹出100个,访问你网页的人不跳脚才奇怪了。
第3个回答 2015-08-14
<?php
echo '<a href="" target="_blank"/>';
?>
echo '<a href="" target="_blank"/>';
?>
第4个回答 2013-05-22
<?php
echo "<script>location.href=''</script>";//跳转百度
?>追问
echo "<script>window.open('');</script>";
?>
//这个是你要的效果,给个采纳吧
echo "<script>location.href=''</script>";//跳转百度
?>追问
我要打开两个网页啊!
追答<?phpecho "<script>window.open('');</script>";
?>
//这个是你要的效果,给个采纳吧