boy / blog_20150318_1_5749868

来自CSDN博客:Bag标签之轻开B2C电子商务网站登录校验实例 http://blog.csdn.net/tx18/article/details/44408829#

  web开发 密码校验 电子商务 用户名校验 邮箱校验 最后更新时间 2015-03-18 14:30:50
blog_20150318_1_5749868 22行 html/xml
Raw
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
<TR>
<TD width=62 align=center>用户选择:</TD>
<TD width=256>
<select name=my_type onChange="swapAction(this.value)">
<chtml>
<if x="@{pPage:i}" else=0>
<option value=0 selected>邮件地址</option>
<option value=1 x=1 selected>手机号码</option>
<option value=2 x=2 selected>VIP卡号</option>
</if>
</chtml>
<option value=0>邮件地址</option>
<option value=1>手机号码</option>
<option value=2>VIP卡号</option>
</select>
</TD></TR>
<TR>
<TD align=center>用  户:</TD>
<TD width=256><INPUT name="username" style="width:220px;height:22px;font-size:14px"/></TD></TR>
<TR>
<TD align=center>密  码:</TD>
<TD><INPUT type="password" name="pass" style="width:120px;height:22px;font-size:14px"/></TD></TR>
blog_20150318_2_893530 1行 html/xml
Raw
 1
<bag id=pPage act=verify><we name="lets.go" type="mail">@{pPage:username}</we></bag>
blog_20150318_3_39945 3行 html/xml
Raw
 1
 2
 3
<if x="@{pPage:lets.go}">
<bag id=pPage x=false><we name="v_pass">false</we><we name="pop.out">@{pPage:pop.out}\n邮件:必须为真实的邮箱地址!</we></bag>
</if>
blog_20150318_4_6362459 3行 html/xml
Raw
 1
 2
 3
<if x="@{trim:@{pPage:pass}}">
<bag id=pPage><we name="v_pass">false</we><we name="pop.out">@{pPage:pop.out}\n密码:不能为空!</we></bag>
</if>
blog_20150318_5_7984109 6行 html/xml
Raw
 1
 2
 3
 4
 5
 6
<if x="@{pPage:v_pass}" else=1>
<we x=false><script>alert("校验未通过!\n\n@{pPage:pop.out}");location.href='@{head:referer}';</script></we>
<we><!-- 检查用户名和密码 -->
... ...
</we>
</if>
blog_20150318_6_4589250 26行 html/xml
Raw
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
<!-- 校验 -->
<bag id=pPage act=verify><we name="lets.go" type="mail">@{pPage:username}</we></bag>
<if x="@{pPage:lets.go}">
<bag id=pPage x=false><we name="v_pass">false</we><we name="pop.out">@{pPage:pop.out}\n邮件:必须为真实的邮箱地址!</we></bag>
</if>
<if x="@{trim:@{pPage:pass}}">
<bag id=pPage><we name="v_pass">false</we><we name="pop.out">@{pPage:pop.out}\n密码:不能为空!</we></bag>
</if>
<if x="@{pPage:v_pass}" else=1>
<we x=false><script>alert("校验未通过!\n\n@{pPage:pop.out}");location.href='@{head:referer}';</script></we>
<we><!-- 检查用户名和密码 -->
<ESql module=help id=user commit=true>Select pass From base_user Where USERNAME='@{pPage:USERNAME}'</ESql>
<if x="@{user:getLength}" else=1>
<we x=0>
<esql module=help act=edit>insert into base_user (username,pass,cnname) values ('@{pPage:username}','@{pPage:pass}','@{strLeft:@{pPage:username}(@)}')</esql>
<bag id=pPage><we name=v_pass>1</we></bag>
</we>
<we>
<if x="@{user:pass}" else=1>
<bag id=pPage x="@{pPage:pass}"><we name=v_pass>1</we></bag>
<bag id=pPage><we name=v_pass>0</we></bag>
</if>
</we>
</if>
</we>
</if>