您所在的位置:小祥子 » CMS学院 » PHPCMS » 正文

phpcms v9首页登录框的实现

时间:2015-01-08 编辑:佚名 来源:互联网

首先找到\PHPcms\templates\default\member\mini.html这个文件
将其内容修改为

{php if(!HTTP_REFERER || strpos(HTTP_REFERER,'&a=login')) @header("Location: ".$_GET['forward']); }
<style>
body,html{background:none; padding:0; margin:0}
.log{line-height:25px; height:139px; width:178px; float:left; font-size:12px; padding-top:10px; padding-left:5px;}
.list { float:left; width:168px; height:30px; line-height:30px; }
</style>
<body style="background-color:transparent">
<div class="log">{if $_username}{L('hellow')} {get_nickname()}<br> <a href="{APP_PATH}index.php?m=member&siteid={$siteid}" target="_blank">{L('member_center')}</a> <a href="{APP_PATH}index.php?m=member&c=index&a=logout&forward={urlencode($_GET['forward'])}&siteid={$siteid}" target="_top">{L('logout')}</a>{else}
<form method="post" action="{APP_PATH}index.php?m=member&c=index&a=login" id="myform" name="myform" target="_top">
<input type="hidden" name="forward" id="forward" value="{if $_GET['forward']}{$_GET['forward']}{else}{HTTP_REFERER}{/if}">
<div class="list">账 号:<input type="text" id="username" name="username" size="15" class="input-text"></div>
<div class="list">密 码:<input type="password" id="password" name="password" size="16" class="input-text"></div>
<div class="list">验 证:<input type="text" id="code" name="code" size="4" class="input-text">{form::checkcode('code_img', '4', '14', 75, 24)}</div>
<div class="list"><input type="submit" name="dosubmit" id="dosubmit" value="{L('login')}"> | <a href="{APP_PATH}index.php?m=member&c=index&a=register&siteid={$siteid}" target="_blank">{L('register')}</a></div>
</form>
{/if}</div>
</body>

在首页调用的方式是

<script type="text/javascript">document.write('<iframe src="{APP_PATH}index.php?m=member&c=index&a=mini&forward='+encodeURIComponent(location.href)+'&siteid={get_siteid()}" allowTransparency="true" width="178" height="139" frameborder="0" scrolling="no"></iframe>')</script>

关键词:登录框
本类热门