<script>if(top==self) url="http://www.baidu.com/"; else url="<?php echo $SongUrl ?>";</script>
<?php $url="<script>document.write(url)</script>";echo $url;?>
<!--
<?php header("Location:".$url."")?>
-->想要实现的功能:
在地址栏直接输入url,跳转到www.baidu.com,否则header location到指定的音频地址($SongUrl)遇到的问题:
用echo输出,显示的url正常,(地址栏直接输入该php地址,echo输出显示:www.baidu.com)
但使用header location后,跳转到的url是encode了的“<script>document.write(url)</script>”(http://域名/%3Cscript%3Edocument.write(tzurl)%3C/script%3E)。而并非跳转到www.baidu.com。求解答