phpcms实现首页可以直接登陆方法
方法如下:
找到phpcms/templates/default/member/mini.html
删除整段代码或者注释,修改成:
<?php defined('IN_PHPCMS') or exit('No permission resources.'); ?> <style> body,html{background:none; padding:0; margin:0} .log{line-height:24px;*line-height:27px; height:24px;float:right; font-size:12px} .log span{color:#ced9e7} .log a{color:#049;text-decoration: none;} .log a:hover{text-decoration: underline;} .log .snda{ position:relative; bottom:-3px} </style> <body style="background-color:transparent"> <div class="log"> <?php if($_username) { ?> <?php echo L('hellow');?> <?php echo get_nickname();?>, <a href="<?php echo APP_PATH;?>index.php?m=member&siteid=<?php echo $siteid;?>" target="_blank"> <?php echo L('member_center');?></a> <a href="<?php echo APP_PATH;?>index.php?m=member&c=index&a=logout&forward=<?php echo urlencode($_GET['forward']);?>&siteid=<?php echo $siteid;?>" target="_top"> <?php echo L('logout');?> </a><?php } else { ?> {php if(!HTTP_REFERER || strpos(HTTP_REFERER,'&a=login'))@header("Location: ".$_GET['forward']);} <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}"> 账号:<input type="text" id="username" name="username" style="width:70px;height:19px; size="10" class="input-text"> 密码:<input type="password" id="password" name="password" style="width:70px;height:19px;" size="10" class="input-text"> 验证码:<input type="text" id="code" name="code" size="5" style="width:30px;height:19px;" class="input-text" > {form::checkcode('code_img', '2', '14', 50, 18)} <input type="submit" name="dosubmit" id="dosubmit" value="{L('登录')}"> | <a href="{APP_PATH}index.php?m=member&c=index&a=register&siteid={$siteid}" target="_blank">{L('注册')} </a> </form> <?php } ?> </div> </body>
然后替换mini.html文件
在修改首页,哪里需要调用就引入一下代码
<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>
本文出自:琅枫个人博客。如需转载请注明出处!
本文出处:"https://www.langfujun.top/learn/php/118.html"
如果您觉得文章对你有帮助,可以进行打赏。
打赏多少,您高兴就行,谢谢您对琅枫博客的支持! ~(@^_^@)~
微信打赏

支付宝打赏
