Ecshop Ajax refreshing Login

Source: Internet
Author: User
<! -- Start text --> <! -- {If $ user_info} --> <Div class = "lef_tit_bj"> member logon </div> <Div class = "left_conn_bj"> <Table width = "100%" border =" 0 "cellspacing =" 0 "cellpadding =" 0 "> <tr> <TD Height =" 50 "align =" center "valign =" Middle "> <label> <strong> hello {$ user_info.username} </strong> </label> </TD> </tr> <TD Height = "30" align = "center" valign = "Middle "> <strong> welcome to our store </strong> </TD> </tr> <TD Height =" 40 "align =" center "valign =" B Ottom "> <label> <a href =" user. php? Act = logout ">  </a> & nbsp; <a href =" user. PHP ">  </a> </label> </TD> </tr> </table> </div> <! -- {Else} --> <Div class = "lef_tit_bj"> member logon </div> <Div class = "left_conn_bj"> <Form ID = "ecs_loginform" name = "ecs_loginform" method = "Post" Action = "javascript: signin () "> <Table width =" 100% "border =" 0 "cellspacing =" 0 "cellpadding =" 0 "> <tr> <TD Height =" 50 "align =" right" valign = "Middle"> User Name: </TD> <TD Height = "50" align = "Left" valign = "Middle"> <label> <input type = "text" name = "username" class =" yonhu_input "Style = "Height: 15px; "/> </label> </TD> </tr> <TD Height =" 30 "align =" right "valign =" Middle "> password & nbsp; code: </TD> <TD Height = "30" align = "Left" valign = "Middle"> <input type = "password" name = "password" class = "yonhu_input" Style = "height: 15px; "/> </TD> </tr> <TD Height =" 40 "colspan =" 2 "align =" center "valign =" bottom "> <label> <input type = "image" name = "imagefield" src = "images/denglu_bann.jpg"/> & nbsp; <a HRE F = "user. php? Act = register ">  </a> </label> </TD> </tr> </table> </form> </div> <! -- {/If} --> {literal} <SCRIPT type = "text/JavaScript"> function signin () {var FRM = document. forms ['ecs _ loginform']; If (FRM) {var username = FRM. elements ['username']. value; var Password = FRM. elements ['Password']. value; var CAPTCHA = ''; If (FRM. elements ['captcha ']) {CAPTCHA = FRM. elements ['captcha ']. value;} If (username. length = 0 | password. length = 0) {/literal} alert ("{$ Lang. empty_username_password }");{ Literal} return;} else {Ajax. Call ('user. php? Act = signin ', 'username =' + username + '& Password =' + encodeuricomponent (password) + '& CAPTCHA =' + CAPTCHA, signinresponse, "Post ", "text") ;}} else {alert ('template error! ') ;}} Function signinresponse (result) {var username = document. forms ['ecs _ loginform']. elements ['username']. value; var mzone = document. getelementbyidx_xx_x ("ecs_memberzone"); var res = result. parsejson (); If (res. error> 0){alert(res.content1_if(res.html) {mzone. innerhtml = res.html; document. forms ['ecs _ loginform']. elements ['username']. value = username ;}} else {If (mzone) {mzone. innerhtml = res. content; evalscript (res. ucdata); // alert (res. ucdata);} else {window. location. reload () }}</script >{/ literal}


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.