In Javascript, you can use the escapeunescape () and eval_r () functions for simple transcoding to make normal URLs look weird, make those annoying search crawlers unable to identify the resources you want to hide. Generally, normal strings must be encoded into the format that can be interpreted by the JavaScript unescape () function. for example, you can use the following function to implement escape () in Javascript () functions are the same:
The code is as follows:
Function escapeToHex ($ string, $ encoding = UTF-8 ){
$ Return =;
For ($ x = 0; $ x <mb_strlen ($ string, $ encoding); $ x ++ ){
$ Str = mb_substr ($ string, $ x, 1, $ encoding );
If (strlen ($ str)> 1) {// multi-byte characters
$ Return. = % u. strtoupper (bin2hex (mb_convert_encoding ($ str, UCS-2, $ encoding )));
} Else {
$ Return. = %. strtoupper (bin2hex ($ str ));
}
}
Return $ return;
}
?>
Suppose we want to hide the following address: http://www.dirk.sh/assets/uploaded/thisistest.pdf
We can use the following script:
The code is as follows:
// Please include the escapeToHex () function definition by yourself
$ Test = document. write (\ test \);
Echo