|
![]() | 作者: wcyzyh [wcyzyh]
![]() |
登录 |
我想在我的网页中显示我朋友的生日,比如还有3天就是XXX的生日了,等到生日那一天就显示今天是XXX的生日,祝他生日快乐!最好是asp和数据库相连的,希望高手们解决我的难题,我在这先谢了!!!!!!! 原标题:[跪求高手帮助]关于生日的系统 [此贴被 286(unique) 在 05月21日09时27分 编辑过] |
地主 发表时间: 04-05-20 21:21 |
![]() | 回复: xiaoshi [xiaoshi] ![]() |
登录 |
给个思路; x = sql shengri from zhuce where xingming = xxx y = data() z = x - y if (z < 0) {"xxx的生日已经过去!"} if (z = 0) { "今天是xxx的生日!" } else { "还有"z"天就是xxx的生日了!" } |
B1层 发表时间: 04-05-21 03:33 |
![]() | 回复: 286 [unique] ![]() |
登录 |
<% birth="5-25" '格式:月-日,没有年。 today=date() birthday=CDate(Left(CStr(today),4)+"-"+birth) diffday=birthday-today if diffday=0 then response.write "今天是你的生日,祝你生日快乐。" else if diffday>0 then response.write "还有"+CStr(diffday)+"就是你的生日了。" else response.write "今年,你的生日已过去"+CStr((-1)*diffday)+"天。" end if end if %> |
B2层 发表时间: 04-05-21 09:46 |
![]() | 回复: 286 [unique] ![]() |
登录 |
小兄弟,附带说一句。 20cn的朋友都会互相帮助的,而不是你跪就帮助不跪就不帮助。 把跪字放到嘴边的人是无法得到别人的尊重的,请勿再以这种方式说话。 |
B3层 发表时间: 04-05-21 09:49 |
![]() | 回复: xiean [xiean] ![]() |
登录 |
人家只是要网页显示。。。弄个 js 不就好了么。。。一个用到数据库,一个用 asp。。。真是杀鸡用牛刀。。。。 |
B4层 发表时间: 04-05-21 09:49 |
![]() | 回复: xiean [xiean] ![]() |
登录 |
<script language="JavaScript"> var bday = new Date("5/26/2004"); var now = new Date(); var str = "今天离Y生日还差"; var d = bday.getTime() - now.getTime(); var s = Math.floor(d / (1000 * 60 * 60 * 24)); if (s >= 0) document.write(""+str+"还有"+s+"天"); </script> |
B5层 发表时间: 04-05-21 09:52 |
![]() | 回复: 286 [unique] ![]() |
登录 |
你这人也真是,人家要ASP的,你拿个JS有什么用? 当没有杀鸡刀时,不用牛刀你还要用什么? |
B6层 发表时间: 04-05-21 09:52 |
![]() | 回复: xiean [xiean] ![]() |
登录 |
用牛刀杀小鸡,用力不爽,还怕把小鸡给切烂,那样小鸡做出来的味道还能好么 ![]() |
B7层 发表时间: 04-05-21 09:56 |
![]() | 回复: 286 [unique] ![]() |
登录 |
人家说了,俺不但要实现这个功能,还不想让用户读到源码,(虽然源码也很烂![]() ![]() ![]() 现在吃鸡哪还象以前整鸡吃呀,现在都是先用牛刀剁成碎肉,然后包饺子吃。 ![]() ![]() ![]() |
B8层 发表时间: 04-05-21 10:30 |
![]() | 回复: yingzike [yingzike] ![]() |
登录 |
最好是asp和数据库相连的,希望高手们解决我的难题,我在这先谢了!!!!!!! 人爱要求就是ASP,你又要怎样? ![]() ![]() ![]() JS也可以看到源码的嘛,呵呵 ![]() ![]() |
B9层 发表时间: 04-05-21 11:11 |
![]() | 回复: NetDemon [netdemon] ![]() |
登录 |
用JS其实不好 1.通常生日的数据在服务器上 2.天数是否正确取决于客户端电脑的时间 如果用户的时间设置为1900,那么将会显示“你Y离出生还有XXXX天,还有XXX年你Y才有生日” ![]() ![]() ![]() ![]() ![]() ![]() |
B10层 发表时间: 04-05-21 12:20 |
![]() | 回复: wcyzyh [wcyzyh] ![]() |
登录 |
是 那兄弟说的真的很对啊 ,谢谢你 跪了真的是不好呀,!呵呵~~~~~ |
B11层 发表时间: 04-05-21 13:11 |
![]() | 回复: wcyzyh [wcyzyh] ![]() |
登录 |
我给怎么样去建一个数据库 ? 然后怎么用源代码连接到我的数据库里 ? 最重要的就是如果有2个以上的人在同一天过生日能同时显示,如果第二天也有人过生日那最好也提醒出来最好了 |
B12层 发表时间: 04-05-21 13:16 |
![]() | 回复: wcyzyh [wcyzyh] ![]() |
登录 |
就说下面的那个程序就不可以同时显示同一天超过两个以上的人,还不提醒第二天过生日的人,可以完善一下么??先谢过了 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>生日提醒</TITLE> <STYLE type=text/css>BODY { FONT-FAMILY: "宋体"; FONT-SIZE: 9pt; MARGIN-LEFT: 0px; MARGIN-RIGHT: 0px; MARGIN-TOP: 0px } A { COLOR: black; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: none } A:hover { COLOR: red; FONT-SIZE: 9pt; FONT-WEIGHT: 400; TEXT-DECORATION: underline } A:active { COLOR: #ff0033; CURSOR: hand; FONT: 9pt "宋体" } </STYLE> <META content="text/html; charset=gb2312" http-equiv=Content-Type> <SCRIPT language=JavaScript> <!-- function birthday(year,month,date,person) { this.year=year this.month=month this.date=date this.person=person } function birthdaylist() { } blist=new birthdaylist() blist[0]= new birthday(1980,6,21,"太阳") blist[1]= new birthday(1980,6,21,"太阳") blist[2]= new birthday(1980,6,21,"太阳") blist[3]= new birthday(1980,6,21,"太阳") blist[4]= new birthday(1980,6,21,"太阳") blist[5]= new birthday(1980,6,21,"太阳") blist[6]= new birthday(1980,6,21,"太阳") blist[7]= new birthday(1980,6,21,"太阳") blist[8]= new birthday(1980,6,21,"太阳") blist[9]= new birthday(1980,6,21,"太阳") blist[10]= new birthday(1980,6,21,"太阳") blist[11]= new birthday(1980,6,21,"太阳") blist[12]= new birthday(1980,6,21,"太阳") blist[13]= new birthday(1980,6,21,"太阳") blist[14]= new birthday(1980,6,21,"太阳") blist[15]= new birthday(1980,6,21,"太阳") blist[16]= new birthday(1980,6,21,"太阳") blist[17]= new birthday(1980,5,22,"太阳") blist[18]= new birthday(1933,5,21,"李琳") //上面添加你朋友的生日列表 var now=new Date() today=new Date(now.getYear(),now.getMonth(),now.getDate()) // today 0:00:00 function daysFromToday(sdate) { return Math.round((sdate.getTime()-today.getTime())/(24*60*60*1000)) } function writeNextBirthday(list) { var daysToClosest=888 var closest for (var i in list) { thisDate=new Date(today.getYear(),list[i].month-1,list[i].date) if (daysFromToday(thisDate)<0) thisDate.setYear(today.getYear()+1) if (daysFromToday(thisDate)<daysToClosest) { daysToClosest=daysFromToday(thisDate) closest=i } } if (daysToClosest==0) document.write("<B><font color=red>今天["+list[closest].person+"]"+"["+(today.getYear()-list[closest].year)+"]岁生日!祝你生日快乐^0^</B>") else if (daysToClosest==1) document.write("<font color=blue>明天["+list[closest].person+"]将过["+(today.getYear()-list[closest].year)+"]岁生日!") else document.write("你最近要过生日的朋友是["+list[closest].person+"]在["+daysToClosest+"]天后。") } // end hiding --> </SCRIPT> <META content="MSHTML 5.00.2614.3500" name=GENERATOR></HEAD> <BODY onLoad="startclock ()" bgColor=#FFFFFF> <CENTER> <font color="red"><font color="#FF3333" size="5">生日提醒</font></font><FONT color=red face=隶书 size=6><br> </FONT> <FONT color=red face=隶书 size=6> </FONT> </CENTER> <div align="center"> <hr size="1" color="#000000" noshade> 现在的日期时间是: <script language=JavaScript> today=new Date(); function initArray(){ this.length=initArray.arguments.length for(var i=0;i<this.length;i++) this[i+1]=initArray.arguments[i] } var d=new initArray( "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"); document.write( "<font color=##000000 style='font-size:9pt;font-family: 宋体'> ", today.getYear(),"年", today.getMonth()+1,"月", today.getDate(),"日", d[today.getDay()+1], "</font>" ); </script> <br> <br> </div> <CENTER> <table width="502" border="1" cellspacing="0" cellpadding="0" bordercolordark="#FFFFFF" bordercolor="#000000"> <tr bgcolor="#CCFFCC"> <td> <div align="center"><font color="#FF3333"></font><font color="#FF3333" size="4">大 家 注 意 了</font></div> </td> </tr> <tr> <td> <div align="center"> <script language=JavaScript> <!-- writeNextBirthday(blist) // --> </script> </div> </td> </tr> </table> <br> </CENTER> </BODY></HTML> |
B13层 发表时间: 04-05-21 13:19 |
![]() | 回复: wcyzyh [wcyzyh] ![]() |
登录 |
也不是我要小题大做啊。主要是我要将100多人的生日都输进去,这样就剩去了天天输入的麻烦了,所以就想到了用数据库和asp的问题了!如果可以象http://user.net163.com/lyhzyh/txl这个网页里的那样的 啊就最好了 |
B14层 发表时间: 04-05-21 13:25 |
![]() | 回复: wcyzyh [wcyzyh] ![]() |
登录 |
帮帮我啊 |
B15层 发表时间: 04-05-21 23:41 |
![]() | 回复: wcyzyh [wcyzyh] ![]() |
登录 |
斑竹 帮帮我啊 |
B16层 发表时间: 04-05-22 23:13 |
![]() | 回复: 286 [unique] ![]() |
登录 |
不是大家不愿意帮助你了,而是你住前看看,问题也帮你分析了,关键代码也给出了,你仍然编不出来,我想问你到底会多少呢?你所问的所有问题差不多都已包含在前面的回答中了。你自己找找看吧。 |
B17层 发表时间: 04-05-24 09:46 |
![]() | 回复: qq32651635 [qq32651635] ![]() |
登录 |
![]() |
B18层 发表时间: 04-05-25 11:19 |
|
20CN网络安全小组版权所有
Copyright © 2000-2010 20CN Security Group. All Rights Reserved.
论坛程序编写:NetDemon
粤ICP备05087286号