可以输入的下拉菜单
摘要:<html> <head> <metahttp-equiv="Content-Type"content="text/html;charset=gb2312"> <title>无标题文档</title> </head> <bodyonload="c_cpua.value=c_cpu.options[c_cpu.selectedIndex].value"> <divstyle="position:absolute;"> &l
阅读全文
提交一次后按钮变灰,防止重复提交表单
摘要:提交一次后按钮变灰,防止重复提交表单 <script> vari=0; functionformCheck(){i++;if(i>1){document.form.submit1.disabled=true;}returntrue;} functionpresskey(eventobject){if(event.ctrlKey&&window.event.keyCode==13){i++;if(i>1){alert('帖子正在发出,请耐心等待!');returnfalse;}this.document.form.submit();docu
阅读全文
js全选 复选框的问题
摘要:<form> <inputtype="checkbox"id="zhz[]"onclick="Btn_click()"/>1<br/> <inputtype="checkbox"id="zhz[]"onclick="Btn_click()"/>2<br/> <inputtype="checkbox"id="zhz[]"onclick="Btn_click()&q
阅读全文
表格不同颜色的循环
摘要:http://www.corange.cn/archives/2008/02/263.html<style> tr{yexj00:expression(this.style.background=(rowIndex%2==1)?'orange':'yellow')} </style> <tablewidth=100%style="border-collapse:collapse;table-layout:fixed"borderrules=cols> <tr> <tdwidth=20%&g
阅读全文
随机提取N条记录[多种数据库方法]
摘要:随机提取10条记录的例子: Sqlserver: selecttop10*from表orderbynewid() Access: SELECTtop10*FROM表ORDERBYRnd(id) Rnd(id)其中的id是自动编号字段,可以利用其他任何数值来完成 比如用姓名字段(UserName) SELECTtop10*FROM表ORDERBYRnd(len(UserName)) MySql: Select*From表OrderByrand()Limit10 随机提取10条记录的例子: Sqlserver: selecttop10*from表orderbynewid() Access: SEL
阅读全文
将IP最后一位替换为星号
摘要:http://www.corange.cn/archives/2008/02/230.html<?php $str='1.1.1.1'; $reg='/((?:/d+/.){3})/d+/'; echopreg_replace($reg,"//1*",$str); ?>
阅读全文
ASP实现禁止从外部提交数据
摘要:<% server_v1=Cstr(Request.ServerVariables("HTTP_REFERER")) server_v2=Cstr(Request.ServerVariables("SERVER_NAME")) ifmid(server_v1,8,len(server_v2))<>server_v2then %> 警告!你正在从外部提交数据!!请立即终止!! <% Response.Redirect"index.asp" endif %><% server_v1=Cstr(Re
阅读全文
用PHP5写的smtp类,支持身份验证、附件、抄送、暗送
摘要:发一个用PHP5写的smtp邮件发送类,支持smtp身份验证,可同时给多人发信,同时支持抄送、暗送、附件等,喜欢的朋友帮我顶起来。这个类需要Fileinfo扩展的支持,有关Fileinfo扩展的更多信息请查看http://www.phpx.com/viewarticle.php?id=115888。 类文件如下: <? /*+--------------------------------------------------+ |文件名:Smtp.php| |创建人:Simon.Ye| |创建时间:2006-10-08| |说 明:smtp邮件发送类| +----------------
阅读全文
创建一个带滚动条的div
摘要:<divid="chatlog"style="border:1pxsolidblack;padding:5px;height:115px;overflow:auto;"></div>http://www.corange.cn/archives/2008/02/238.html
阅读全文
ASP程序中同一个用户不允许同时登陆两次
摘要:同一个用户不允许同时登陆两次实现办法一、 登陆页login.asp: <% ifrequest.Form.count>0then session("username")=request("username") application(session("username"))=session.SessionID response.Redirect("index.asp") endif %> <formmethod=postaction=""> <inputtyp
阅读全文
ASP输出成n列的表格形式显示的方法,多行多列
摘要:http://www.corange.cn/archives/2008/01/141.html'定义变量 Dimcn,rs,Sql Sql="selectCustomerIDfromOrders" '记录总数 DimTotalNumbe Setcn=Server.CreateObject("ADODB.Connection") cn.Open"Provider=SQLOLEDB.1;UserID=sa;InitialCatalog=NorthWind;DataSource=.;Password=;" Setrs=Ser
阅读全文
文本溢出后用省略号代替
摘要:<!doctypehtmlpublic"-//w3c//dtdhtml4.01//en""http://www.w3.org/tr/html4/strict.dtd"> <html> <head> <metahttp-equiv=content-typecontent="text/html;charset=utf-8"> <title>onunderflow</title> <scriptlanguage="JavaScript">
阅读全文
表单内容长度限制,带计数
摘要:<scripttype="text/javascript"> /* FormfieldLimiterscript-ByDynamicDrive ForfullsourcecodeandmoreDHTMLscripts,visithttp://www.dynamicdrive.com ThiscreditMUSTstayintactforuse */ varns6=document.getElementById&&!document.all functionrestrictinput(maxlength,e,placeholder){ if(win
阅读全文
Input文本框随着输入内容多少自动延伸
摘要:<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <htmlxmlns="http://www.w3.org/1999/xhtml"> <head> <metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/
阅读全文
实现页面加载中。。
摘要:<scripttype="text/javascript"> window.onload=function(){ vara=document.getElementById("loading"); a.parentNode.removeChild(a); } document.write('<divid="loading"style="background:#CC4444;color:#FFF;width:75px;line-height:20px;position:absolute;padding:
阅读全文