在head之间加上下面代码试试:
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
加了
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
的话也要刷一次才显出到(连接是也算是刷了一次),但不加上面的代码,有时候刷来刷去还是显示以前的数据。@_@晕啊
<?php
session_cache_limiter('public');
session_start();
//print_r($_SESSION);
if ($username == "")
{
echo "<script language='javascript'>\n";
echo "top.location='index.php'\n";
echo "</script>";
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<title>产品类别管理</title>
<link href="../css/dbms.css" rel="stylesheet" type="text/css">
<script language='javascript'>
function del(id)
{
if(confirm('你真的要删除这个类别吗?'))
{
self.location='altersort.php?action=del&id='+id;
}
}
</script>
</head>
<?
require('../Connections/conn.php'); mysql_select_db($database_conn, $conn); //这里分页,读取数据库模块
if (($_GET["action"] == "") || ($_GET["action"] == "listsort"))
{
$query_sort_Rst = "SELECT * FROM `product_sort` ORDER BY `sort_id` DESC";
$sort_Rst = mysql_query($query_sort_Rst, $conn) or die(mysql_error());
$totalRows_sort_Rst = mysql_num_rows($sort_Rst);
//echo $totalRows_sort_Rst;
//echo $query_sort_Rst;
mysql_free_result($sort_Rst);
$pagesize = 10;
$maxpage = ceil($totalRows_sort_Rst/$pagesize);
//echo "<br>" . $maxpage;
$pagecount = $_GET['pageno'];
if ($_GET['pageno'] == "")
{
$pagecount = 1;
}
if ($pagecount >= $maxpage)
{
$pagecount = $maxpage;
}
$offsetp = $pagesize * $pagecount;
If ($pagecout == 1)
{
$query_limit = "0,10";
}
else
{
$query_limit = $offsetp-$pagesize . ",10";
}
if ($maxpage == 1)
{
$cutpage = "1/1";
}
else
{
$cutpage = $pagecount."/".$maxpage;
}
if ($totalRows_sort_Rst == 1)
{
$cutrow = "1-1";
}
elseif ($offsetp > $totalRows_sort_Rst)
{
$cutrow = ($offsetp-$pagesize+1). "-" . $totalRows_sort_Rst;
}
else
{
$cutrow = ($offsetp-$pagesize+1) . "-" . $offsetp;
}
$query_sort_Rst = "SELECT * FROM `product_sort` LIMIT " . $query_limit;
//echo $query_sort_Rst;
$sort_Rst = mysql_query($query_sort_Rst, $conn) or die(mysql_error());
$row_sort_Rst = mysql_fetch_assoc($sort_Rst);
}
?>
<body bgcolor="#6699CC" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="80%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td valign="middle">
<table width="95%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#333333">
<tr bgcolor="#006699">
<td height="20" colspan="2" align="center"><strong><font color="#FFFFFF">产品类别管理模块</font></strong></td>
</tr>
<tr>
<td width="14%" height="125" align="center" valign="top" bgcolor="#A9C6E2"><table width="100" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="100" border="0" cellspacing="1" cellpadding="0">
<tr>
<td height="30" align="center" bgcolor="#6699CC"><a hidefocus=true href="sort.php?action=addsort">新建类别</a></td>
</tr>
<tr>
<td height="30" align="center" bgcolor="#6699CC"><a hidefocus=true href="sort.php?action=listsort&pageno=1">查看类别</a>
</td>
</tr>
</table>
</td>
<td width="86%" align="center" valign="top" bgcolor="#A9C6E2">
<?
if ($_GET['action'] == "addsort")
{
?>
<table width="450" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="450" border="0" align="center" cellpadding="0" cellspacing="1">
<form method="post" name="form1" action="altersort.php">
<tr valign="baseline">
<td width="80" align="right"><font size="2">新类别名</font></td>
<td width="212"><div align="center">
<input name="sort" type="text" class="mybutton" value="" size="32">
</div></td>
<td width="154"><input name="submit" type="submit" class="mybutton" value="添加">
<input type="hidden" name="addsort" value="form1"></td>
</tr>
</form>
</table>
<?
}
elseif ($_GET['action'] == "listsort")
{
echo $query_sort_Row;
?>
<table width="450" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<table width="450" border="0" cellspacing="1" cellpadding="0">
<tr>
<td height="20" align="center" bgcolor="#6699CC">
<a hidefocus=true href="sort.php?pageno=1&action=listsort">首页 </a><font color="#FFFFFF">|</font>
<? if ((($pagecount-1) < 1) || ($maxpage == 1)) {?>
<font size="2" color="#CCCCCC">上一页 </font>
<? } else {?>
<a hidefocus=true href="sort.php?pageno=<? echo $pagecount-1;?>&action=listsort">上一页</a>
<? }?>
<font color="#FFFFFF">|</font>
<? if (($pagecount+1) > $maxpage) {?>
<font size="2" color="#CCCCCC">下一页</font>
<? } else {?>
<a hidefocus=true href="sort.php?pageno=<? echo $pagecount+1;?>&action=listsort">下一页</a>
<? }?>
<font color="#FFFFFF">|</font>
<a hidefocus=true href="sort.php?pageno=<? echo $maxpage;?>&action=listsort">末页</a>
<font color="#FFFFFF" size="2">当前<? echo $cutpage;?>页 当前<?echo $cutrow?>条 共条<?echo $totalRows_sort_Rst;?>记录</font>
</td>
</tr>
</table>
<table width="450" border="0" cellspacing="1" cellpadding="0">
<tr align="center" bgcolor="#006699">
<td width="150" height="20"><font color="#FFFFFF" size="2">类别ID号</font></td>
<td width="150" height="20"><font color="#FFFFFF" size="2">类别名</font></td>
<td width="150" height="20"><font color="#FFFFFF" size="2">操作</font></td>
</tr>
<?php do { ?>
<tr align="center" bgcolor="#6699CC">
<td width="150" height="20"><?php echo $row_sort_Rst['sort_id']; ?></td>
<td width="150" height="20"><?php echo $row_sort_Rst['sort']; ?></td>
<td width="150" height="20"><a hidefocus=true href="sort.php?action=edit&id=<?php echo $row_sort_Rst['sort_id']; ?>">修改</a><font color="#FFFFFF">|</font><a hidefocus=true href="#" OnClick="del(<?php echo $row_sort_Rst['sort_id']; ?>);">删除</a></td>
</tr>
<?php } while ($row_sort_Rst = mysql_fetch_assoc($sort_Rst)); ?>
<tr align="center">
<td width="150" height="20"> </td>
<td width="150" height="20"> </td>
<td width="150" height="20"> </td>
</tr>
</table>
<?
mysql_free_result($sort_Rst);
}
if ($_GET['action'] == "ecdt")
{
}
?>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p> </p>
</body>
</html>
<?php
//mysql_free_result($sort_Rst);
mysql_close($conn);
?>
function del(id)
{
if(confirm('你真的要删除这个类别吗?'))
{
document.wirite("<meta http-equiv=refresh content=0;url=*.php>");
}
}
</script>
如果这句去掉,那问题就可以解决了!
但如果一定要session_cache_limiter('public'); 那我很抱歉!我只是发现了问题,而没有解决问题的办法!我也在等高手帮助解决这个问题
用这个就可以了~我都你的贴发一下~
session_cache_limiter('private, must-revalidate');