在index.php 的顶部添加
require "global.php";
if (empty($pauserinfo[username]))
{
eval("\$login_panelbit .= \"".gettemplate('index_loginpanel')."\";" );
eval( "\$login_panel= \"".gettemplate('login_panel')."\";" );
} else {
eval( "\$login_panelbit .= \"".gettemplate('login_panel2')."\";" );
eval("\$login_panel= \"".gettemplate('login_panel')."\";" );
}
if (empty($pauserinfo[username]))
{
eval("\$login_panelbit .= \"".gettemplate('index_loginpanel')."\";" );
eval( "\$login_panel= \"".gettemplate('login_panel')."\";" );
} else {
eval( "\$login_panelbit .= \"".gettemplate('login_panel2')."\";" );
eval("\$login_panel= \"".gettemplate('login_panel')."\";" );
}
后台添加3个模版,分别是index_loginpanel,显示提示用户登录的窗口,login_panel2显示登录后的信息,login_panel用来中转用的
index_loginpanel内容为
<table width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="loginpic/login_bg_bot.gif" >
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="3" width="200">
<tr> <form name="" method="post" action="member.php">
<td colspan="2" width="200">
<input name="username" maxlength="20" size="15" style="float: right">username</td> </tr>
<td colspan="2" width="200">
<input type="password" name="password" maxlength="20" size="15" style="float: right">password</td> </tr>
<tr> <td colspan="2" width="200">
<p align="center"> <input type="image" border='0' src='$phparticleurl/images/login.jpg' width='68' height='19' class="button"> php学习之家
<a href="$phparticleurl/register.php">
<img src='$phparticleurl/images/reg.jpg' width='68' height='19' border='0'></a>
<input type="hidden" name="action" value="login">
<input type="hidden" name="url" value="$url">
</td></tr>
</form>
</table></center>
</div>
</td> </tr> </table>
login_panel2
<table width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="loginpic/login_bg_bot.gif" >
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="3" width="200">
<tr> <td colspan="2" width="200">
</td> </tr>
<td colspan="2" width="200">
<font color="#00B21B">$pauserinfo[username]</font>
<a href="$phparticleurl/member.php?action=logout">
<input type="hidden" name="action" value="login">
<input type="hidden" name="url" value="$url">
LogOut</a></font></td></tr>
</table></center>
</div>
</td> </tr> </table><BR>
www.444p.com版权所有
<tr>
<td background="loginpic/login_bg_bot.gif" >
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="3" width="200">
<tr> <form name="" method="post" action="member.php">
<td colspan="2" width="200">
<input name="username" maxlength="20" size="15" style="float: right">username</td> </tr>
<td colspan="2" width="200">
<input type="password" name="password" maxlength="20" size="15" style="float: right">password</td> </tr>
<tr> <td colspan="2" width="200">
<p align="center"> <input type="image" border='0' src='$phparticleurl/images/login.jpg' width='68' height='19' class="button"> php学习之家
<a href="$phparticleurl/register.php">
<img src='$phparticleurl/images/reg.jpg' width='68' height='19' border='0'></a>
<input type="hidden" name="action" value="login">
<input type="hidden" name="url" value="$url">
</td></tr>
</form>
</table></center>
</div>
</td> </tr> </table>
login_panel2
<table width="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td background="loginpic/login_bg_bot.gif" >
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="3" width="200">
<tr> <td colspan="2" width="200">
</td> </tr>
<td colspan="2" width="200">
<font color="#00B21B">$pauserinfo[username]</font>
<a href="$phparticleurl/member.php?action=logout">
<input type="hidden" name="action" value="login">
<input type="hidden" name="url" value="$url">
LogOut</a></font></td></tr>
</table></center>
</div>
</td> </tr> </table><BR>
login_panel
$login_panelbit
















