会员模块(会员注册、会员登录、忘记密码、会员中心)

会员注册

html代码:

<form id="register_form" data-url="/tools/submit_ajax.ashx?action=user_register&site=zh_cn">
    <div class="account_creation">
        <div class="required form-group">
            <label for="customer_firstname">用户名<sup>*</sup></label>
            <input type="text" class="is_required validate form-control" id="customer_firstname" name="txtUserName" 
        ajaxurl
="/tools/submit_ajax.ashx?action=validate_username&site=zh_cn" datatype="*" nullmsg="请输入用户名!" sucmsg=" "/> </div> <div class="required form-group"> <label for="email">电子邮箱<sup>*</sup></label> <input type="text" class="is_required validate form-control" id="email" name="txtEmail" datatype="e" nullmsg="请输入您的电子邮箱!" sucmsg=" "/> </div> <div class="required password form-group"> <label for="passwd">密码<sup>*</sup></label> <input type="password" class="is_required validate form-control" name="txtPassword" id="passwd" datatype="*6-20" nullmsg="请输入密码!" sucmsg=" "/> <span class="form_info Validform_checktip">(至少6位字符)</span> </div> <div class="required password form-group"> <label for="qrpasswd">确认密码<sup>*</sup></label> <input type="password" class="is_required validate form-control" name="txtPassword1" id="qrpasswd" datatype="*" recheck="txtPassword" nullmsg="请输入确认密码!" sucmsg=" "/> <span class="form_info Validform_checktip">(至少6位字符)</span> </div> </div> <div class="submit clearfix"> <button type="submit" id="submitAccount" class="btn btn-default button button-medium"> <span>注册</span> </button> <p class="reqfields required"><span><sup>*</sup>必填字段</span></p> </div> <p class="register-info"></p> </form>

C#代码:

private void user_register(HttpContext context)
{
    string site = STRequest.GetQueryString("site").Trim(); //当前所属站点
    string code = STRequest.GetFormString("txtCode").Trim(); //验证码
    string username = Utils.ToHtml(STRequest.GetFormString("txtUserName").Trim()); //用户名
    string password = STRequest.GetFormString("txtPassword").Trim(); //密码
    string email = Utils.ToHtml(STRequest.GetFormString("txtEmail").Trim()); //邮箱   
    string nickname = Utils.ToHtml(STRequest.GetFormString("txtNickName").Trim()); //用户昵称
    string avatar = Utils.ToHtml(STRequest.GetFormString("txtAvatar").Trim()); //头像
    string sex = Utils.ToHtml(STRequest.GetFormString("txtSex").Trim()); //性别
    string birthday = Utils.ToHtml(STRequest.GetFormString("txtBirthday").Trim()); //生日
    string mobile = Utils.ToHtml(STRequest.GetFormString("txtMobile").Trim()); //手机号码
    string telphone = Utils.ToHtml(STRequest.GetFormString("txtTelphone").Trim()); //电话号码
    string qq = Utils.ToHtml(STRequest.GetFormString("txtQQ").Trim()); //QQ号码
    string msn = Utils.ToHtml(STRequest.GetFormString("txtMsn").Trim()); //MSN
    string address = Utils.ToHtml(STRequest.GetFormString("txtAddress").Trim()); //地址
    int userGroupId = STRequest.GetFormInt("hidGroupId"); //所属组别ID
    string userip = STRequest.GetIP();
}

 

会员登录

html代码:

<form data-url="/tools/submit_ajax.ashx?action=user_login&site=zh_cn" id="login_form">
    <div class="form_content clearfix">
        <div class="form-group">
            <label for="email">电子邮箱</label>
            <input class="is_required validate account_input form-control" type="text" id="email" name="txtUserName" datatype="e" nullmsg="请输入电子邮箱!" sucmsg=" "/>
        </div>
        <div class="form-group">
            <label for="passwd">密码</label>
            <span><input class="is_required validate account_input form-control" type="password" id="passwd" name="txtPassword" datatype="*6-20" nullmsg="请输入密码!" sucmsg=" "/></span>
        </div>
        <p class="lost_password form-group"><a href="#">忘记密码?</a></p>
        <p class="submit">
            <button type="submit" id="SubmitLogin" class="button btn btn-default button-medium">
                <span>登录</span>
            </button>
        </p>
    </div>
</form>

C#代码:

private void user_login(HttpContext context)
{
    string site = STRequest.GetQueryString("site"); //当前所属站点
    string username = STRequest.GetFormString("txtUserName"); //用户名
    string password = STRequest.GetFormString("txtPassword"); //密码
    string remember = STRequest.GetFormString("chkRemember"); //记住密码
}

 

忘记密码

html代码:

 

会员导航栏

<%set Suctan.Model.User uModel=GetUserInfo() %>
<%if(uModel!=null)%>
<!--登录状态-->
<span class="login-all">尊敬的{uModel.user_name},您好!<a href="<%linkurl("usercenter","exit")%>">退出</a></span>
<%else%>
<!--未登录状态-->
<span class="container-centre-span">
<a href="javascritp:;" onclick="register();">会员注册</a>
<a href="javascritp:;" onclick="login();">会员登录</a>
</span>
<%/if%>

 

posted @ 2016-04-19 15:46  吖然-jronny  阅读(625)  评论(0编辑  收藏  举报