function parseurl($url, $text, $scheme) {     global $_G;     if(!$url && preg_match("/((https?|ftp|gopher|news|telnet|rtsp|mms|callto|bctp|thunder|qqdl|synacast){1}:\/\/|www\.)[^\[\"']+/i", trim($text), $matches)) {          $url = $matches[0];          $length = 200;          if(strlen($url) > $length) {               $text = substr($url, 0, intval($length * 0.5)).' ... '.substr($url, - intval($length * 0.3));          }          return '<a href="http://localhost/go.php?url='.(substr(strtolower($url), 0, 4) == 'www.' ? 'http://'.$url : $url).'" target="_blank">'.$text.'</a>';     } else {          $url = substr($url, 1);          if(substr(strtolower($url), 0, 4) == 'www.') {               $url = 'http://'.$url;          }          $url = !$scheme ? $_G['siteurl'].$url : $url;          return '<a href="http://localhost/go.php?url='.$url.'" target="_blank">'.$text.'</a>';     }}

解决方案 »

  1.   

    网址的参数值经过url传递,都进行了unicode 所以需要通过urlencode处理
      

  2.   

    <?php
    $url = preg_match("/^url=(.*)$/i",$_SERVER['QUERY_STRING'], $matches)? $matches[0] : '';
    echo "正在跳转到<a href='$url'>$url</a>";
    ?>echo "正在跳转到<a href='$url'>$url</a>"; 这句怎么写啊。
      

  3.   

    return '<a href="http://localhost/go.php?url='.urlencode($url).'" target="_blank">'.$text.'</a>';
      

  4.   


    您好 那我这段该怎么改呀。
    <?php
    $url=$_GET['url'];
    echo "正在跳转到<a href='$url'>$url</a>";
    ?>