新人求助,如何点击数据库标题后跳转详细页面显示内容 大神们,我做毕业设计这里要设计点击新闻标题后跳转到详细页面,我数据库表里有ID,标题,内容,时间。我使用DW做的这是新闻总览这是详细内容 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <a href=view.phph?id={Recordset1.id}>{Recordset1.title}</a> 图一标题页<table width="586" height="37" border="0"> <tr> <td width="416"><a href="xinwenneirong.php"><?php echo $row_Recordset1['title']; ?></a></td> <td width="160"><?php echo $row_Recordset1['date']; ?></td> </tr> </table>图二内容<table width="600" height="400" border="0"> <tr> <td height="24" align="center" valign="middle"><?php echo $row_Recordset1['title']; ?></td> </tr> <tr> <td height="360" valign="top"><?php echo $row_Recordset1['text']; ?></td> </tr> </table>连接数据库<?php require_once('Connections/qiyewangzhan.php'); ?><?phpif (!function_exists("GetSQLValueString")) {function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue;}}$currentPage = $_SERVER["PHP_SELF"];$maxRows_Recordset1 = 8;$pageNum_Recordset1 = 0;if (isset($_GET['pageNum_Recordset1'])) { $pageNum_Recordset1 = $_GET['pageNum_Recordset1'];}$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;mysql_select_db($database_qiyewangzhan, $qiyewangzhan);$query_Recordset1 = "SELECT * FROM news ORDER BY id DESC";$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);$Recordset1 = mysql_query($query_limit_Recordset1, $qiyewangzhan) or die(mysql_error());$row_Recordset1 = mysql_fetch_assoc($Recordset1);if (isset($_GET['totalRows_Recordset1'])) { $totalRows_Recordset1 = $_GET['totalRows_Recordset1'];} else { $all_Recordset1 = mysql_query($query_Recordset1); $totalRows_Recordset1 = mysql_num_rows($all_Recordset1);}$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;$colname_Recordset2 = "-1";if (isset($_GET['id'])) { $colname_Recordset2 = $_GET['id'];}mysql_select_db($database_qiyewangzhan, $qiyewangzhan);$query_Recordset2 = sprintf("SELECT * FROM news WHERE id = %s ORDER BY id DESC", GetSQLValueString($colname_Recordset2, "int"));$Recordset2 = mysql_query($query_Recordset2, $qiyewangzhan) or die(mysql_error());$row_Recordset2 = mysql_fetch_assoc($Recordset2);$totalRows_Recordset2 = mysql_num_rows($Recordset2);$queryString_Recordset1 = "";if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_Recordset1") == false && stristr($param, "totalRows_Recordset1") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams)); }}$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);?> <a href="xinwenneirong.php?在这里传递文章id"><?php echo $row_Recordset1['title']; ?></a> 如何获取传递后的参数呢。 是不是使用$Get_Recordset1['id'];放到和传递参数一样的位置<td height="24" align="center" valign="middle"><?php echo $row_Recordset1['title']; ?></td> </tr> <tr> <td height="360" valign="top"> <?php echo $row_Recordset1['text']; ?></td> </tr> 首先在页面上面加上GET参数 直接跳转到处理方法里面去,用GET方式获取到文章ID 后,把数据取出来 然后用include把HTML 页面引入进来 然后把对应的变量写到页面上就可以了 如何获取传递后的参数呢。 是不是使用$Get_Recordset1['id'];放到和传递参数一样的位置<td height="24" align="center" valign="middle"><?php echo $row_Recordset1['title']; ?></td> </tr> <tr> <td height="360" valign="top"> <?php echo $row_Recordset1['text']; ?></td> </tr>如何获取URL传递的参数都不知道?说明你基础知识还没学好,建议先过一遍基础知识。磨刀不误砍柴功呀。 写一个正则表达式判断下面 两个网址格式正则表达式 正确, 最后一个错误 Headers and client library minor version mismatch php 带权随机数 求方法,截取字符串中的文字 网上一段简单的preg_match替换 不明 php正则匹配为什么不成功?求助 问个头疼的问题,在linux下PHP如何来打开word/excel的文件? 关于网站架构的问题各位给看看 如何得到当前系统的分辨率?谢谢 php json数据gzip压缩输出 loop循环 萌新求助关于自动关机的问题(非常重要已尝试百度,不是普通的自动关机)
<table width="586" height="37" border="0">
<tr>
<td width="416"><a href="xinwenneirong.php"><?php echo $row_Recordset1['title']; ?></a></td>
<td width="160"><?php echo $row_Recordset1['date']; ?></td>
</tr>
</table>图二内容
<table width="600" height="400" border="0">
<tr>
<td height="24" align="center" valign="middle"><?php echo $row_Recordset1['title']; ?></td>
</tr>
<tr>
<td height="360" valign="top"><?php echo $row_Recordset1['text']; ?></td>
</tr>
</table>连接数据库
<?php require_once('Connections/qiyewangzhan.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
} $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}$currentPage = $_SERVER["PHP_SELF"];$maxRows_Recordset1 = 8;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;mysql_select_db($database_qiyewangzhan, $qiyewangzhan);
$query_Recordset1 = "SELECT * FROM news ORDER BY id DESC";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $qiyewangzhan) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;$colname_Recordset2 = "-1";
if (isset($_GET['id'])) {
$colname_Recordset2 = $_GET['id'];
}
mysql_select_db($database_qiyewangzhan, $qiyewangzhan);
$query_Recordset2 = sprintf("SELECT * FROM news WHERE id = %s ORDER BY id DESC", GetSQLValueString($colname_Recordset2, "int"));
$Recordset2 = mysql_query($query_Recordset2, $qiyewangzhan) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);?>
</tr>
<tr>
<td height="360" valign="top">
<?php echo $row_Recordset1['text']; ?></td>
</tr>
</tr>
<tr>
<td height="360" valign="top">
<?php echo $row_Recordset1['text']; ?></td>
</tr>
如何获取URL传递的参数都不知道?说明你基础知识还没学好,建议先过一遍基础知识。磨刀不误砍柴功呀。