<?php require_once('E:\phpDev\ch10\connections\conn_news.php'); ?>
<?php
mysql_select_db($database_conn_news, $conn_news);
$query_newsType1 = "SELECT * FROM newstable ORDER BY newsTime DESC";
$newsType1 = mysql_query($query_newsType1, $conn_news) or die(mysql_error());
$row_newsType1 = mysql_fetch_assoc($newsType1);
$totalRows_newsType1 = mysql_num_rows($newsType1);$MM_paramName = ""; // *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
// create the list of parameters which should not be maintained
$MM_removeList = "&index=";
if ($MM_paramName != "") $MM_removeList .= "&".strtolower($MM_paramName)."=";
$MM_keepURL="";
$MM_keepForm="";
$MM_keepBoth="";
$MM_keepNone="";
// add the URL parameters to the MM_keepURL string
reset ($_GET);
while (list ($key, $val) = each ($_GET)) {
$nextItem = "&".strtolower($key)."=";
if (!stristr($MM_removeList, $nextItem)) {
$MM_keepURL .= "&".$key."=".urlencode($val);
}
}
// add the URL parameters to the MM_keepURL string
if(isset($HTTP_POST_VARS)){
reset ($HTTP_POST_VARS);
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
$nextItem = "&".strtolower($key)."=";
if (!stristr($MM_removeList, $nextItem)) {
$MM_keepForm .= "&".$key."=".urlencode($val);
}
}
}
// create the Form + URL string and remove the intial '&' from each of the strings
$MM_keepBoth = $MM_keepURL."&".$MM_keepForm;
if (strlen($MM_keepBoth) > 0) $MM_keepBoth = substr($MM_keepBoth, 1);
if (strlen($MM_keepURL) > 0) $MM_keepURL = substr($MM_keepURL, 1);
if (strlen($MM_keepForm) > 0) $MM_keepForm = substr($MM_keepForm, 1);mysql_select_db($database_conn_news, $conn_news);
$query_newsType1 = "SELECT * FROM newstable WHERE newsType = 1";
mysql_query("SET NAMES 'GB2312'");
$newsType1 = mysql_query($query_newsType1, $conn_news) or die(mysql_error());
$row_newsType1 = mysql_fetch_assoc($newsType1);
$totalRows_newsType1 = mysql_num_rows($newsType1);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>所有社会新闻</title>
<style type="text/css">
<!--
.STYLE1 { font-family: "隶书";
font-size: 24px;
color: #006633;
}
a:link {
color: #990000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #990000;
}
a:hover {
text-decoration: none;
color: #999900;
}
a:active {
text-decoration: none;
color: #990000;
}
-->
</style>
</head><body>
<table width="100%" border="0">
<tr>
<td colspan="2" align="center" valign="middle"><span class="STYLE1">公司新闻</span></td>
</tr>
<?php do { ?>
<tr>
<td colspan="2" bgcolor="#f4f4f4"> </td>
</tr>
<tr>
<td align="center"></td>
<td align="right"></td>
</tr>
<tr>
<td align="center"><a href="SNewsDetail.php?<?php echo $MM_keepURL.(($MM_keepURL!="")?"&":"")."newsID=".$row_newsType1['newsID'] ?>"><?php echo $row_newsType1['newsTitle']; ?></a></td>
<td align="right"><?php echo $row_newsType1['newsTime']; ?></td>
</tr>
<?php } while ($row_newsType1 = mysql_fetch_assoc($newsType1)); ?>
</table>
<p><a href="index.php">[返回首页]</a></p>
</body>
</html>
<?php
mysql_free_result($newsType1);
?>
初学PHP,从第9行:
$MM_paramName = "";
开始就看不明白了,请高手帮帮忙,谢谢!
<?php
mysql_select_db($database_conn_news, $conn_news);
$query_newsType1 = "SELECT * FROM newstable ORDER BY newsTime DESC";
$newsType1 = mysql_query($query_newsType1, $conn_news) or die(mysql_error());
$row_newsType1 = mysql_fetch_assoc($newsType1);
$totalRows_newsType1 = mysql_num_rows($newsType1);$MM_paramName = ""; // *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
// create the list of parameters which should not be maintained
$MM_removeList = "&index=";
if ($MM_paramName != "") $MM_removeList .= "&".strtolower($MM_paramName)."=";
$MM_keepURL="";
$MM_keepForm="";
$MM_keepBoth="";
$MM_keepNone="";
// add the URL parameters to the MM_keepURL string
reset ($_GET);
while (list ($key, $val) = each ($_GET)) {
$nextItem = "&".strtolower($key)."=";
if (!stristr($MM_removeList, $nextItem)) {
$MM_keepURL .= "&".$key."=".urlencode($val);
}
}
// add the URL parameters to the MM_keepURL string
if(isset($HTTP_POST_VARS)){
reset ($HTTP_POST_VARS);
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
$nextItem = "&".strtolower($key)."=";
if (!stristr($MM_removeList, $nextItem)) {
$MM_keepForm .= "&".$key."=".urlencode($val);
}
}
}
// create the Form + URL string and remove the intial '&' from each of the strings
$MM_keepBoth = $MM_keepURL."&".$MM_keepForm;
if (strlen($MM_keepBoth) > 0) $MM_keepBoth = substr($MM_keepBoth, 1);
if (strlen($MM_keepURL) > 0) $MM_keepURL = substr($MM_keepURL, 1);
if (strlen($MM_keepForm) > 0) $MM_keepForm = substr($MM_keepForm, 1);mysql_select_db($database_conn_news, $conn_news);
$query_newsType1 = "SELECT * FROM newstable WHERE newsType = 1";
mysql_query("SET NAMES 'GB2312'");
$newsType1 = mysql_query($query_newsType1, $conn_news) or die(mysql_error());
$row_newsType1 = mysql_fetch_assoc($newsType1);
$totalRows_newsType1 = mysql_num_rows($newsType1);
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>所有社会新闻</title>
<style type="text/css">
<!--
.STYLE1 { font-family: "隶书";
font-size: 24px;
color: #006633;
}
a:link {
color: #990000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #990000;
}
a:hover {
text-decoration: none;
color: #999900;
}
a:active {
text-decoration: none;
color: #990000;
}
-->
</style>
</head><body>
<table width="100%" border="0">
<tr>
<td colspan="2" align="center" valign="middle"><span class="STYLE1">公司新闻</span></td>
</tr>
<?php do { ?>
<tr>
<td colspan="2" bgcolor="#f4f4f4"> </td>
</tr>
<tr>
<td align="center"></td>
<td align="right"></td>
</tr>
<tr>
<td align="center"><a href="SNewsDetail.php?<?php echo $MM_keepURL.(($MM_keepURL!="")?"&":"")."newsID=".$row_newsType1['newsID'] ?>"><?php echo $row_newsType1['newsTitle']; ?></a></td>
<td align="right"><?php echo $row_newsType1['newsTime']; ?></td>
</tr>
<?php } while ($row_newsType1 = mysql_fetch_assoc($newsType1)); ?>
</table>
<p><a href="index.php">[返回首页]</a></p>
</body>
</html>
<?php
mysql_free_result($newsType1);
?>
初学PHP,从第9行:
$MM_paramName = "";
开始就看不明白了,请高手帮帮忙,谢谢!
解决方案 »
- 仿制麦小偷 小偷程序 用PHP实现目标地址栏转换
- 高手file file_get_contents HTTP request failed
- 急死了,我要将数据通过按钮存入MYSQL,怎么弄呀?
- 急急急,PHP,数据库中createtime字段类型为datetime,怎样根据这个查询一段时间内的数据
- 将ansi格式存储的文件转为utf-8 (php)
- 为什么用fopen()函数不能创建文件?帮帮忙啦(急)
- 急问:请问如何获得当前页面所在目录的相对路径?◎!现场给分!◎
- 哪位大哥有空来帮个忙!?谢谢。
- 关于session的问题
- 关于 jquery ajax php的问题
- 大家帮帮忙啊!
- 归求php代码 1~100猜数字
$MM_removeList = "&index=";
if ($MM_paramName != "") $MM_removeList .= "&".strtolower($MM_paramName)."=";
$MM_keepURL="";
$MM_keepForm="";
$MM_keepBoth="";
$MM_keepNone="";
我弄不清楚这几个变量时做什么的,请高手给予指点!