1.在织梦网站需要调用当前会员信息的页面的head部分加上如下代码: script language=javascript src=/include/dedeajax2.js/scriptscript language=javascript type=text/javascript function CheckLogin(){var taget_obj = docu
1.在织梦网站需要调用当前会员信息的页面的head部分加上如下代码:
<script language="javascript" src="/include/dedeajax2.js"></script> <script language="javascript" type="text/javascript"> function CheckLogin(){ var taget_obj = document.getElementById('_userlogin');/*这里的名字一定要和调用的页面使用的ID值一致*/ myajax = new DedeAjax(taget_obj,false,false,'','',''); myajax.SendGet2("/member/ajax_loginsta.php");/*可以复制上面的loginsta 在php页面填写需要的信息 最后记住一定要改名字哦。具体操作看第二步*/ DedeXHTTP = null; } </script>
2.在需要放织梦会员信息的位置加上如下代码:
<div class="t_hui" id="_userlogin"> <form name='form1' method='POST' action='/member/index_do.php'> <input type="hidden" name="fmdo" value="login"> <input type="hidden" name="dopost" value="login"> <input type="hidden" name="gourl" value=""> <p><span>用户名:</span> <input name="userid" id="txtUsername type="text" class="kuang" /> </p> <p><span>密 码:</span> <input id="txtPassword" type="password" name="pwd" class="kuang" /> </p> <p><button id="btnSignCheck" class="button" type="submit">登录</button><a href="/member/index_do.php?fmdo=user&dopost=regnew">注册</a></p> <div class="clear"></div> </form> </div> <script language="javascript" type="text/javascript">CheckLogin();</script>