近一段时间网上对BLOG恶意评论与引用越来越猖狂,真是太可恶了,提交需要验证码也不能阻止,真是气死我了. 想想原因,还是在验证码上,网上传说那些机器人可以分析验证码图片,真是太牛X了,但是你分析出来了也还是要提交的,对,就从输入框这下手,阻止他们!! 这招还真管用,我的BLOG自从换了验证码输入形式以后,几乎没有了机器人提交的东西,呵呵.下面给大家分享一下,希望为清理网络环境出一点力!
// JavaScript Document===验证码表现类
/*
///////////////////////////////////////////////////////////////////////////////
Jena’s Blog
作 者: 迦楠(Jena.want)
版权所有: IsHere.cn
技术支持: jena.want@gmail.com
单元名称: JENAValidCode
开始时间: 2007-5-30
最后修改:
参 数: instanceName-输入框名称;imgUrl-验证码程序地址;inputAmount-验证码位数.
备 注: 这是一个验证码表现类,支持内嵌各种类型的验证程序(gif,bmp…)
///////////////////////////////////////////////////////////////////////////////
*/
var inputsAmount;
function JENAValidCode(instanceName,imgUrl,inputAmount,inputStyle){
this.InstanceName = instanceName || ‘CheckCode’;
this.ImgUrl = imgUrl || ‘CheckCode.asp’;
this.InputAmount = inputAmount || 4;
this.InputStyle = inputStyle || ‘text’;
inputsAmount=this.InputAmount;
}
JENAValidCode.prototype.Create=function(){
var strs=”";
strs+= “<input name=\”"+ this.InstanceName +”\” type=\”hidden\” id=\”"+ this.InstanceName +”\” />”;
for(var i=1;i<=this.InputAmount;i++){
if(i==1){
strs+= “<input name=\”scode1\” id=\”scode1\” maxlength=\”1\” type=\”text\” class=\”"+ this.InputStyle +”\” onKeyUp=\”javascript:if(this.value!=”&&scode”+ (i+1) +”.value==”){scode”+ (i+1) +”.style.display=”;scode”+ (i+1) +”.focus();this.style.borderRight=’0px’;}”+ this.InstanceName +”.value=MusterValue()\” style=\”text-align:center; width:14px;\” />”;
}else if(i==this.InputAmount){
strs+= “<input name=\”scode”+ i +”\” id=\”scode”+ i +”\” maxlength=\”1\” type=\”text\” class=\”"+ this.InputStyle +”\” style=\”display:none;text-align:center; width:14px; border-width:1px 1px 1px 0px\” onKeyUp=\”javascript:”+ this.InstanceName +”.value=MusterValue()\” />”;
}else{
strs+= “<input name=\”scode”+ i +”\” id=\”scode”+ i +”\” maxlength=\”1\” type=\”text\” class=\”"+ this.InputStyle +”\” style=\”display:none;text-align:center; width:14px; border-width:1px 1px 1px 0px\” onKeyUp=\”javascript:if(this.value!=”&&scode”+ (i+1) +”.value==”){scode”+ (i+1) +”.style.display=”;scode”+ (i+1) +”.focus();this.style.borderRight=’0px’;}”+ this.InstanceName +”.value=MusterValue()\” />”;
}
}
strs+= ” <img src=\”"+ this.ImgUrl +”? + Math.random()\” id=\”secCode\” align=\”absmiddle\” />”;
strs+= “<span style=\”font-family:Verdana;font-size:9px;cursor:pointer;\” onclick=\”javascript:document.getElementById(’secCode’).src=’”+ this.ImgUrl +”?’ + Math.random();scode1.value=”;scode1.focus();”
for(var i=2;i<=this.InputAmount;i++){
strs+=”scode”+ i +”.value=”;”
}
strs+=”\”> Another</span>”;
document.writeln(strs);
//return strs;
}
function MusterValue(){
var mustervalue=”";
for(var i=1;i<=inputsAmount;i++){
mustervalue+=document.getElementById(”scode”+i).value
}
return mustervalue;
}
function setCookie(name,value) { var Days = 30; var exp = new Date(); //new Date(”December 31, 9998″); exp.setTime(exp.getTime() + Days*24*60*60*1000); document.cookie = name + “=”+ escape (value) + “;expires=” + exp.toGMTString(); } function getCookie(name) { var arr,reg=new RegExp(”(^| )”+name+”=([^;]*)(;|$)”); if(arr=document.cookie.match(reg)) return unescape(arr[2]); else return null; } function delCookie(name) { var exp = new Date(); exp.setTime(exp.getTime() - 1); var cval=getCookie(name); if(cval!=null) document.cookie= name + “=”+cval+”;expires=”+exp.toGMTString(); }
function DateAdd(interval,number,date){
/*
*————— DateAdd(interval,number,date) —————–
* DateAdd(interval,number,date)
* 功能:实现VBScript的DateAdd功能.
* 参数:interval,字符串表达式,表示要添加的时间间隔.
* 参数:number,数值表达式,表示要添加的时间间隔的个数.
* 参数:date,时间对象.
* 返回:新的时间对象.
* var now = new Date();
* var newDate = DateAdd(”d”,5,now);
* author:wanghr100(灰豆宝宝.net)
* update:2004-5-28 11:46
* modify:Jean.want(ishere.cn)
* modifydate:2007-5-23 16:57
*————— DateAdd(interval,number,date) —————–
*/
number=parseInt(number);
switch(interval){
case “y” :
{date.setFullYear(date.getFullYear()+number); break; }
case “q” : { date.setMonth(date.getMonth()+number*3); break; }
case “m” : { date.setMonth(date.getMonth()+number); break; }
case “w” : { date.setDate(date.getDate()+number*7); break; }
case “d” : { date.setDate(date.getDate()+number); break; }
case “h” : { date.setHours(date.getHours()+number); break; }
case “m” : { date.setMinutes(date.getMinutes()+number); break; }
case “s” : { date.setSeconds(date.getSeconds()+number); break; }
default : { date.setDate(d.getDate()+number); break; }
}
return date.toLocaleDateString();
}
http://www.ishere.cn//uploads/200705/22_084457_girlfriendthebestdamnthing.mp3
Avril Lavigne - The Best Damn Thing
专辑:The Best Damn Thing
LRC Produced By
Album:The Best Damn Thing
Avril Lavigne-The Best Damn Thing
Let me hear you say hey hey hey
Alright, now let me hear you
say hey hey ho
I hate it when a guy doesn’t get the door
Even though I told him yesterday
and the day before
I hate it when a guy
doesn’t get the tab
And I have to pull my money out
and that looks bad
Where are the hopes,
where are the dreams
My Cinderella story scene
When do you think
they’ll finally see
That you’re not not not
gonna get any better
You won’t won’t won’t
you won’t get rid of me never
Like it or not even though
she’s a lot like me
We’re not the same
And yeah yeah yeah
I’m a lot to handle
You don’t know trouble
but I’m a hell of a scandal
Me I’m a scene
I’m a drama queen
I’m the best damn thing
that your eyes have ever seen
Alright Alright yeah
I hate it when a guy doesn’t understand
Why a certain time of month
I don’t want to hold his hand
I hate it when they go out and we stay in
And they come home smelling like
their ex-girlfriend
But I found my hopes
I found my dreams
My Cinderella story scene
Now everybody’s gonna see
That you’re not not not
gonna get any better
You won’t won’t won’t
you won’t get rid of me never
Like it or not even though
she’s a lot like me
We’re not the same
And yeah yeah yeah
I’m a lot to handle
You don’t know trouble
but I’m a hell of a scandal
Me I’m a scene I’m a drama queen
I’m the best damn thing
that your eyes have ever seen
Give me an A,
always give me what I want
Give me a V,
be very very good to me
R, are you gonna treat me right
I, I can put up a fight
Give me an L,
let me hear you scream loud
One two three four
Where are the hopes,
where are the dreams
My Cinderella story scene
When do you think
they’ll finally see
That you’re not not not
gonna get any better
You won’t won’t won’t
you won’t get rid of me never
Like it or not even though
she’s a lot like me
We’re not the same
And yeah yeah yeah
I’m a lot to handle
You don’t know trouble
but I’m a hell of a scandal
Me I’m a scene I’m a drama queen
I’m the best damn thing
that your eyes have ever seen
Let me hear you say hey hey hey
Alright, now let me hear
you say hey hey ho
I’m the best damn thing
that your eyes have ever seen
在 JScript 表达式中,正则表达式后面的全局标志 (’g') 表示该表达式将用来在输入字符串中查找尽可能多的匹配。大小写敏感性由表达式结束处的大小写敏感性标记 (’i') 指定。
中午喝了点酒,呵呵.
然后又翻看了以前的照片,去年大跃进的照片,一张张熟悉的笑脸,好亲切!可是现在都不在身边了,为了工作各奔东西,虽然在同一座城市,却难得见上一面.
在一起的感觉真好,想念我的朋友们!
于是,我决定这个周末邀他们出来玩,夏天到了,喝个散啤,吃个烧烤,应该也是一件快乐的事情!
邮箱格式要求是:
- 必须包含一个并且只有一个符号@
- 第一个字符不能是’@'或者’.’
- 不允许出现’@.’或者’.@’或者’-@’或者’@-’
- 结尾不得是字符’@'或者’.’
- 字符@后面只能是’A-Za-z0-9′
<script> function checkMail(str){ var strReg=”"; var r; var strText=document.all(str).value; //strReg=/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/i; strReg=/^\w+((-\w+)|(\.\w+))*\@{1}\w+\.{1}\w{2,4}(\.{0,1}\w{2}){0,1}/ig; r=strText.search(strReg); if(r==-1) { alert(”邮箱格式错误!”); document.all(str).focus(); } } </script>
<input name=”email” type=”text” class=”input” id=”email” onChange=”checkMail(’email’)”>