回精華區
作者tandrian.bbs@ntcb.twbbs.org.tw (幻域魔城後祖), 看板: itoc
標題Re: [問題] 註冊新帳號時,如何讓使用者直接填生日…等等
時間幻御魔城 (Wed Jul 10 11:47:58 2002) Updated: 2004/03/05
這是之前itoc大大po出來的....之前有的就問我吧~ ^^

: bbsd.c acct_apply()

  do
  {
    vget(21, 0, "真實姓名:", cuser.realname, RNLEN + 1, DOECHO);
  } while (strlen(cuser.realname) < 4);

+ do
+ {
+   if (vget(22, 0, "出生年份(民國):", buf, 3, DOECHO))
+     cuser.year = atoi(buf);
+ } while (cuser.year < 1 || cuser.year > 99);

+ do
+ {
+   if (vget(22, 0, "出生月份:", buf, 3, DOECHO))
+     cuser.month = atoi(buf);
+ } while (cuser.month < 1 || cuser.month > 12);

+ do
+ {
+   if (vget(22, 0, "出生日期:", buf, 3, DOECHO))
+     cuser.day = atoi(buf);
+ } while (cuser.day < 1 || cuser.day > 31);

+ do
+ {
+   if (vget(22, 0, "性別 (0)中性 (1)男性 (2)女性 [0]:", buf, 3, DOECHO))
+     cuser.sex = buf[0] - '0';
+ } while (cuser.sex < 0 || cuser.sex > 2);

--
                           
  ╦═╗ ╬══ ╔══ ╠═╗  □ Origin: 幻域魔城 ntcb.twbbs.org
  ╝  ╚ ╚══ ╚══ ╚═╝  □ From:140.131.114.191
╚                           ╝
精華選讀←離開[主題上]主題下(k)上篇(j)下篇S/a搜尋 G串列 TAB精華 ↑↓捲 Pg/Space翻