search

Home  >  Q&A  >  body text

javascript - php检测网址 跳转页面

首先看一段js代码:

MacPlayer.Html = '<iframe width="100%" height="'+MacPlayer.Height+'" allowTransparency="true" frameborder="0" scrolling="no" src="http://www.qbzhan.com/chaojikan.php?url='+MacPlayer.PlayUrl+'"></iframe>';
MacPlayer.Show();

http://www.qbzhan.com/chaojik...

需求:

写一段php代码检测等于号后面的内容:

所指的php代码也就是:http://www.qbzhan.com/chaojik...

如果访问地址是:
http://www.qbzhan.com/chaojik...

那让php跳转到:新连接:
http://www.qbzhan.com/iqi.php...
也就是:
http://www.qbzhan.com/iqi.php...

漂亮男人漂亮男人2738 days ago524

reply all(2)I'll reply

  • 怪我咯

    怪我咯2017-05-16 12:04:09

    Your URLs have all become links, please modify them, otherwise I won’t understand what question you are asking

    reply
    0
  • 高洛峰

    高洛峰2017-05-16 12:04:09

    Solved, thank you

    <?php
    $url=empty($_GET['vid'])?$_GET['url']:$_GET['vid'];
    $needleA= 'acfun.cn'; $needleB= 'iqiyi.com'; $needleC= 'v.qq.com'; $needleD= 'youku.com'; $needleE= 'toutiao.com';
         if(strpos($url, $needleA)>0){echo "<script>window.onload=function(){location.href='http://www.12399688.com/index/acfun.php?url=$url';}</script>";}
    else if(strpos($url, $needleB)>0){echo "<script>window.onload=function(){location.href='http://www.65yw.com/rooog1/iqiyi.php?id=$url';}</script>";}
    else if(strpos($url, $needleC)>0){echo "<script>window.onload=function(){location.href='http://www.12399688.com/index/qqvod.php?url=$url';}</script>";}
    else if(strpos($url, $needleD)>0){echo "<script>window.onload=function(){location.href='http://www.12399688.com/index/youku.php?url=$url';}</script>";}
    else if(strpos($url, $needleE)>0){echo "<script>window.onload=function(){location.href='http://www.12399688.com/index/https.php?url=$url';}</script>";}
    else{echo "<script>window.onload=function(){location.href='http://www.12399688.com/admin.php?url=$url';}</script>";}
    ?>

    reply
    0
  • Cancelreply