本帖最后由 z13754418942 于 2014-09-06 04:49:04 编辑

解决方案 »

  1.   


    <?php
    $send = isset($_POST['send'])? $_POST['send'] : '';
    $url = isset($_POST['url'])? $_POST['url'] : '';
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
     <head>
      <meta http-equiv="content-type" content="text/html; charset=utf-8">
      <title>test</title>
     </head> <body>
      <form name="form1" method="post" action="get.php">
      <p>url:<input type="text" name="url" value="<?php echo $url; ?>"></p>
      <p><input type="submit" name="b1" value="submit"></p>
      <input type="hidden" name="send" value="true">
      </form>  
        <?php
        if($send=='true'){
            $file=file_get_contents($url);
            htmlspecialchars($file);
            $pattern='/<div class="vBox js_player" id="(.*?)"><\/div>/';
            preg_match($pattern,$file,$result);
            $vid=($result[1]);
            if($vid){
                echo '<embed src="http://mat1.gtimg.com/weishi/player/weishiplayerIn.swf" flashvars="vid='.$vid.'" width="458" height="492">';
            }
        }
        ?>
     </body>
    </html>