加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ecshop ajax无刷新登陆

发布时间:2020-12-16 01:39:42 所属栏目:百科 来源:网络整理
导读:!--{if $user_info}-- div class="lef_tit_bj"会员登陆/div div class="left_conn_bj" table width="100%" border="0" cellspacing="0" cellpadding="0" tr td height="50" align="center" valign="middle"labelstrongHello {$user_info.username}/strong/la

<!--{if $user_info}-->


<div class="lef_tit_bj">会员登陆</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>

<tr>

<td height="30" align="center" valign="middle"><strong>欢迎光临本店</strong></td>

</tr>

<tr>

<td height="40" align="center" valign="bottom"><label>

<a href="user.php?act=logout"> <img src="../images/tuichu.gif"></a>

&nbsp;

<a href="user.php"> <img src="../images/jinrultan.gif"></a>

</label></td>

</tr>

</table>

</div>

</div>


<!--{else}-->



<div class="lef_tit_bj">会员登录</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">用户名:</td>

<td height="50" align="left" valign="middle"><label>

<input type="text" name="username" class="yonhu_input" style="height:15px;"/>

</label></td>

</tr>

<tr>

<td height="30" align="right" valign="middle"> 密&nbsp; 码:</td>

<td height="30" align="left" valign="middle"><input type="password" name="password" class="yonhu_input" style="height:15px;" /></td>

</tr>

<tr>

<td height="40" colspan="2" align="center" valign="bottom"><label>

<input type="image" name="imageField" src="images/denglu_bann.jpg" />

&nbsp;

<a href="user.php?act=register"><img src="images/zhuce_bann.jpg" border="0" /></a>

</label></td>

</tr>

</table>

</form>

</div>

</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_x("ECS_MEMBERZONE");

var res = result.parseJSON();


if (res.error > 0)

{

alert(res.content);

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}

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读