0

你能注意到什么问题吗?到目前为止,在我的测试中,每当我有查询时,我都会得到一个 HTTP 500。我对 PHP 很陌生,可以得到尽可能多的帮助。

    <?php
require_once "dbConnect.php";
require "../www/showArticle.php";

$queryBodyCommand = "SELECT pbody FROM pages WHERE id='$pageid' LIMIT 1";
$queryBody = mysql_query($sqlConnect, $queryBodyCommand) or die (mysql_error()); 
while ($row = mysql_fetch_array($queryBody)) { 
    $body = $row["pbody"];
    $title = $row["title"];
}  
mysql_free_result($queryBody);

$queryLabelCommand = "SELECT id, label FROM pages WHERE showLabel ='1' AND enabled ='1' ORDER BY id ASC"; 
$queryLabel = mysql_query($sqlConnect, $queryLabelCommand) or die (mysql_error()); 
while ($row = mysql_fetch_array($queryLabel)) {
    $pid = $row["id"];
    $label = $row["label"];
    $menuList = '<a href="index.php?pid=' . $pid . '">' . $label . '</a><br />';
    } 
mysql_free_result($queryBody);

?>

这是我的 showArticle.php:

<?php
require_once('../sub/dbConnect.php');
require('../sub/functions.php');
if (!$_GET['pid']) {
    $pageid = '1';
} else {
    $pageid = ereg_replace("[^0-9]", "", $_GET['pid']);
}
?>

<!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=utf-8" />
<title><?php echo $title; ?></title>
</head>
<body>
<?php echo $title; ?>
Body:
<?php echo $body; ?>
</body>
</html>
4

1 回答 1

0

尝试:

require_once('dbConnect.php');
require('../www/showArticle.php');
于 2012-11-28T00:47:41.443 回答