时间:2022-10-18加入收藏
function randomString(len) {
len = len || 32;
var $chars = 'ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678';
var maxPos = $chars.length;
var pwd = '';
for (i = 0; i < len; i++) {
pwd += $chars.charAt(Math.floor(Math.random() * maxPos));
}
return pwd;
}
var sjurl="http://www.bingdou.com.cn/"+randomString(6)+".html"
//在需要插入随机链接的地方插入"sjurl"这个变量即可.
<?php
function createRandomStr($length){
$str = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';//62个字符
$strlen = 62;
while($length > $strlen){
$str .= $str;
$strlen += 62;
}
$str = str_shuffle($str);
return substr($str,0,$length);
}
$sjurl = "http://www.bingdou.com.cn/".createRandomStr(6).".html";
//说明:直接调用上面的变量名“sjurl”即可实现随机效果,createRandomStr(6)中的6代表随机6位字符,可自行修改。
//如果要直接使PHP跳转,请在最后一行加入:header("location: $sjsjurl");
<%
Function gen_key(digits)
dim char_array(80)
For i = 0 To 9
Randomize
char_array(i) = CStr(i)
Next
For i = 10 To 35
Randomize
char_array(i) = Chr(i + 55)
Next
For i = 36 To 61
Randomize
char_array(i) = Chr(i + 61)
Next
do while len(output) < digits
num = char_array(Int((62 - 0 + 1) * Rnd + 0))
output = output & num
loop
gen_key = output
TGA: 技巧