这是我的短信管理页的代码
<?php session_start(); include("conn/conn.php"); if ($_GET['page']=="") {$_GET['page']=1;}?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>短信管理</title>
<style type="text/css">
<!--
body {
background-color: #FFFFFF;
}
-->
</style></head><body>
<table align="center" width="950" height="103" border="1" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#F4F5F9">
<tr>
<td height="36" colspan="3"> <?php echo $_GET[sender];?> 您好:您现在有
<?php
$query=mysql_query("select * from lt_mail_box where lt_receiving_person='$_GET[sender]' and lt_mail_type=''");
$myrow=mysql_num_rows($query);
echo $myrow;
?>
条未读信息!</td>
</tr>
<tr>
<td width="263" height="39" align="center"> <a href="send_mail.php?sender=<?php echo $_GET[sender];?>&&mails=收件箱">收件箱</a></td>
<td width="244" align="center"><a href="send_mail.php?sender=<?php echo $_GET[sender];?>&&mails=发件箱">发件箱</a></td>
<td width="425" align="center"><a href="send_mail.php?sender=<?php echo $_GET[sender];?>&&mails=写信">写信</a></td>
</tr>
<tr>
<td colspan="3" align="center"><table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><?php
switch($mails){
case "":
include("write_mail.php");
break;
case "写信":
include("write_mail.php");
break;
case "收件箱":
include("browse_mail.php");
break;
case "发件箱":
include("browse_send_mail.php");
break;
}
?></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
为什么运行后我点击收件箱,发件箱他还是不变,仍在写信那一页。好像switch语句没有起作用,求解
<?php session_start(); include("conn/conn.php"); if ($_GET['page']=="") {$_GET['page']=1;}?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>短信管理</title>
<style type="text/css">
<!--
body {
background-color: #FFFFFF;
}
-->
</style></head><body>
<table align="center" width="950" height="103" border="1" cellpadding="1" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#F4F5F9">
<tr>
<td height="36" colspan="3"> <?php echo $_GET[sender];?> 您好:您现在有
<?php
$query=mysql_query("select * from lt_mail_box where lt_receiving_person='$_GET[sender]' and lt_mail_type=''");
$myrow=mysql_num_rows($query);
echo $myrow;
?>
条未读信息!</td>
</tr>
<tr>
<td width="263" height="39" align="center"> <a href="send_mail.php?sender=<?php echo $_GET[sender];?>&&mails=收件箱">收件箱</a></td>
<td width="244" align="center"><a href="send_mail.php?sender=<?php echo $_GET[sender];?>&&mails=发件箱">发件箱</a></td>
<td width="425" align="center"><a href="send_mail.php?sender=<?php echo $_GET[sender];?>&&mails=写信">写信</a></td>
</tr>
<tr>
<td colspan="3" align="center"><table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center"><?php
switch($mails){
case "":
include("write_mail.php");
break;
case "写信":
include("write_mail.php");
break;
case "收件箱":
include("browse_mail.php");
break;
case "发件箱":
include("browse_send_mail.php");
break;
}
?></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
为什么运行后我点击收件箱,发件箱他还是不变,仍在写信那一页。好像switch语句没有起作用,求解
;<a href="send_mail.php?sender=<?php echo $_GET[sender];?>&&mails=收件箱">收件箱</a>这里出现两个& 这正常嘛?
你可以到send_mail.php 输出你的$_GET 看看你都获取到了什么参数就清楚了
一个很严重的问题是你的的$mails参数是未赋值的....
$mails= isset($_GET['mails'])?$_GET['mails']:'';