⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 menu.php

📁 希望这个对大家有用
💻 PHP
字号:
<?php 
if (!isset($_SESSION)) session_start();
if ( isset ( $_GET["op"] ) && $_GET["op"] == "logout" ) {
  unset ( $_SESSION["MM_Username"] );  
  session_unset();
  session_destroy ();
  header ( "Location login.php" );
}
$currentPage = basename ( $PHP_SELF );			// 获取当前页路径
// 从会员变量中读取用户名信息
// 当会员登录到网站后,用户名被保存到会话变量MM_Username中
if ( isset ( $_SESSION["MM_Username"] ) )
  $username = $_SESSION["MM_Username"];
else
  $username = "游客";  
?> 
&nbsp;&nbsp;<img src="images/logo.gif" width="159" height="31" />
<table width="99%" border="0" align="center" cellpadding="1" cellspacing="1" class="tbbd">
<tr>
<td width="12%" align="center" nowrap="nowrap">欢迎您,<?php echo $username; ?>&nbsp;</td>
<?php if ( strcmp ( $currentPage, "index.php" ) == 0) { ?>
<td width="12%" align="center" nowrap="nowrap" class="selected">&raquo;系统首页&laquo;</td>
<?php } else { ?>
<td width="12%" align="center" nowrap="nowrap"><a href="index.php">系统首页</a></td>
<?php } ?>
<?php if ( strcmp ( $currentPage, "login.php" ) == 0  ) { ?>
<td width="12%" align="center" nowrap="nowrap" class="selected">&raquo;会员登录&laquo;</td>
<?php } else { ?>
<td width="12%" align="center" nowrap="nowrap"><a href="login.php">会员登录</a></td>
<?php } ?>
<?php if ( strcmp ( $currentPage, "register.php" ) == 0 ) { ?>
<td width="12%" align="center" nowrap="nowrap" class="selected">&raquo;会员注册&laquo;</td>
<?php } else { ?>
<td width="12%" align="center" nowrap="nowrap"><a href="register.php">会员注册</a></td>
<?php } ?>
<?php if ( preg_match ( "/^getpwd/", $currentPage ) ) { ?>
<td width="12%" align="center" nowrap="nowrap" class="selected">&raquo;找回密码&laquo;</td>
<?php } else { ?>
<td width="12%" align="center" nowrap="nowrap"><a href="getpwd1.php">找回密码</a></td>
<?php } ?>
<?php if ( strcmp ( $currentPage, "modify.php" ) == 0 ) { ?>
<td width="12%" align="center" nowrap="nowrap" class="selected">&raquo;修改资料&laquo;</td>
<?php } else { ?>
<td width="12%" align="center" nowrap="nowrap"><a href="modify.php">修改资料</a></td>
<?php } ?>
<?php if ( strcmp ( $currentPage, "select.php" ) == 0  || strcmp ( $currentPage, "upload.php" ) ==  0 ) { ?>
<td width="12%" align="center" nowrap="nowrap" class="selected">&raquo;上传照片&laquo;</td>
<?php } else { ?>
<td width="12%" align="center" nowrap="nowrap"><a href="upload.php">上传照片</a></td>
<?php } ?>
<?php if ( strcmp ( $currentPage, "manage.php" ) == 0 ) { ?>
<td width="12%" align="center" nowrap="nowrap" class="selected">&raquo;系统维护&laquo;</td>
<?php } else { ?>
<td width="12%" align="center" nowrap="nowrap"><a href="manage.php">系统维护</a></td>
<?php } ?>
<?php if( $username != "游客" ){ ?>
<td width="12%" align="center" nowrap="nowrap"><a href="login.php?op=logout">注销</a></td>
<?php } ?>
</tr>
</table>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -