技术教程
当前位置:首页 > 技术教程

PHP搭配JS进行加密跳转

( 更新:07-28   加入收藏)

<?php 
// Javascript/HTML hex encode 
function encode($input) 

    $temp = ''; 
    $length = strlen($input); 
    for($i = 0; $i < $length; $i++) 
        $temp .= '%' . bin2hex($input[$i]); 
    return $temp; 

$str = encode("<script type=\"text/javascript\">window.location.href='https://www.bingdou.com.cn/';</script>"); 
$replace = str_replace("%"," ",$str);
echo '<script>function QccdsXAoJuGaADBXiUhi(ahKRrF){document.write((unescape(ahKRrF)));};QccdsXAoJuGaADBXiUhi("'.$replace.'".replace(/ /g, "%"));</script>';
?>

相关阅读