Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[插件] 必须填写正常出生年份 For 4.1.0(最后更新13/3 07:20am)

[复制链接]
狗日的北大 发表于 2006-3-30 21:46:05 | 显示全部楼层
可是这并非真正的验证了正常的出生日期,我来帮楼主添加一下限制相应年月的日期吧。
初次写PHP语言,可能看起来不够简洁,望各位牛人见谅!希望得到牛人们的指教!谢谢!

在楼主添加的代码后面添加如下代码:




  1. if($month == 2){
  2.                 if($year%4==0&&$year%100!=0||$year%400==0){
  3.                    if( $day > 29){
  4.                    showmessage('profile_year_invalid');
  5.                    }
  6.                 }
  7.                 elseif( $day > 28){
  8.                  showmessage('profile_year_invalid');
  9.                 }
  10. }
  11.                 if($month==4||$month==6||$month==9||$month==11){
  12.         if($day>30){
  13.         showmessage('profile_year_invalid');
  14.         }
  15. }
复制代码

在相应的register.php和memcp.php中添加即可。并把相应的提示错误信息改成:
  1. 'profile_year_invalid' => '您设置的出生年月日无效,请返回修改。'
复制代码

[ 本帖最后由 狗日的北大 于 2006-3-30 21:47 编辑 ]
回复

使用道具 举报

lanlandetian 发表于 2006-4-10 08:33:26 | 显示全部楼层
dingdingding.......
回复

使用道具 举报

yy2099 发表于 2006-4-10 17:56:47 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

yorokonde 发表于 2006-4-21 01:18:35 | 显示全部楼层
恩。。。可以填入2月31日的问题不知可解决否?
回复

使用道具 举报

onlinexm 发表于 2006-5-12 01:01:21 | 显示全部楼层
是不错。支持一下。
回复

使用道具 举报

kook12368 发表于 2006-5-29 14:15:37 | 显示全部楼层
在// Regular Expression for "Guest" of different languages上加入
        if(!$bday) {
                showmessage('请输入您的生日.');
        }
才是实现真正的必填
回复

使用道具 举报

 楼主| hklcf 发表于 2006-8-28 10:38:27 | 显示全部楼层
upup
回复

使用道具 举报

hewenqiang 发表于 2006-9-1 00:40:01 | 显示全部楼层
很不错呀。
回复

使用道具 举报

温馨5201314 发表于 2006-11-28 00:08:24 | 显示全部楼层
原帖由 Neptune 于 2006-3-13 14:30 发表
既然用上了填年份,送給那些填月份和日期的朋友︰
在register.php和memcp.php加入(加入地方和樓主的一樣)


樓主的 ...
if($year) {
        if($year > $timenow['year'] - 5 || $year < $timenow['year'] - 95) {
                showmessage('profile_year_invalid');
        }
}


需要加吗 ???
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-6-24 20:54 , Processed in 0.097626 second(s), 15 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表