gpt4 book ai didi

php - 在我的一个页面中有两个 "Include"的问题 - PHP

转载 作者:太空宇宙 更新时间:2023-11-03 19:37:14 24 4
gpt4 key购买 nike

<?php require_once('php/auth.php'); ?>

<!DOCTYPE html>
<head>

<title></title>
<link type="text/css" rel="stylesheet" href="design.css" />
<meta http-equiv="refresh" content="120" >


<!-- Start of slideshow -->

<style type="text/css">
.slideshow { height: auto; width: auto; margin: auto }
.slideshow img { padding: 15px; border: 1px solid #ccc; background-color: #eee; }
</style>
<!-- include jQuery library -->
<script type="text/javascript" src="jquery/lib.js"></script>
<!-- include Cycle plugin -->
<script type="text/javascript" src="jquery/slider.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.slideshow').cycle({
fx: 'fade' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
});
});
</script>



<!-- END of slideshow-->



</head>

<body bgcolor="#FFFF66">

<div id="contain">

<!-- Master header for all the pages -->
<?php include 'php/head.php'; ?>

<div id="bodyDiv">

<?php

// Div for the slider in jquery
echo "<div class='slideshow'>";

// Both of these are working when tested and included alone
// This is where my problem lies, if I include them both, the 2nd one will not appear, the first one will only be showing its output.
include 'php/bussvolci.php';
include 'php/bussvolap.php';
echo "</div>";
?>


</div>


</div>

</body>


</html>

如代码部分所述,我的问题在于两个只显示 1 个输出的包含,它只会输出 include 'php/bussvolci.php'; 并且会忽略/或不执行不在 include 'php/bussvolap.php' 中显示任何输出。我已经单独测试了它们并且它们都有效,但是当我将它们放在一个页面中时,我希望以幻灯片效果显示报告,只显示第一个表。这些页面都输出具有不同数据的 1 个表,但来自单个表。你们能帮我解决这个问题吗?

这是我的 bussvolap.php

<!DOCTYPE html>

<head>
<link type="text/css" rel="stylesheet" href="../design.css" />
</head>

<body>

<?php

function inputDate(){
define('TIMEZONE', 'Asia/Manila');
date_default_timezone_set(TIMEZONE);
return date('Y-m-d');
}

include 'con_test.php';

echo "<table name='volAp' cellspacing='0' cellpadding='0' border='1' rules='rows' style='font-family:Calibri; margin:0 auto 0 auto; font-size:15px; text-align:center; padding:4px;'>
<tr border='1'>
<th>&nbsp;&nbsp;Products&nbsp;&nbsp;</th>
<th>&nbsp;&nbsp;Real Estate&nbsp;&nbsp;</th>
<th>&nbsp;&nbsp;TVR&nbsp;&nbsp;</th>
<th>&nbsp;&nbsp;Auto Appraisal&nbsp;&nbsp;</th>
</tr>";


// START OF Mortgage PRODUCT --------------------------------------------

// Mortgage - Real Estate
if ($result = $con->query("
SELECT `recID`
FROM `samprec`
WHERE `recDate` = '".inputDate()."'
AND `rec_prod` = 'Mortgage'
AND `rec_proc` = 'Appraisal - Real Estate'")) {

/* determine number of rows result set */
$row_cnt = $result->num_rows;

printf("<tr><td>Mortgage</td> <td> %d </td>", $row_cnt);

/* close result set */
$result->close();
}

// end of Mortgage - Real Estate

// Mortgage - TVR
if ($result = $con->query("
SELECT `recID`
FROM `samprec`
WHERE `recDate` = '".inputDate()."'
AND `rec_prod` = 'Mortgage'
AND `rec_proc` = 'Appraisal - TVR'")) {

/* determine number of rows result set */
$row_cnt = $result->num_rows;

printf("<td>%d</td>", $row_cnt);

/* close result set */
$result->close();
}
// end of Mortgage TVR

echo "<td> - </td></tr>";

// End OF Mortgage PRODUCT --------------------------------------------


// START OF SME PRODUCT --------------------------------------------

// Mortgage - Real Estate
if ($result = $con->query("
SELECT `recID`
FROM `samprec`
WHERE `recDate` = '".inputDate()."'
AND `rec_prod` = 'SME'
AND `rec_proc` = 'Appraisal - Real Estate'")) {

/* determine number of rows result set */
$row_cnt = $result->num_rows;

printf("<tr><td>SME</td> <td> %d </td>", $row_cnt);

/* close result set */
$result->close();
}

// end of Mortgage - Real Estate

// Mortgage - TVR
if ($result = $con->query("
SELECT `recID`
FROM `samprec`
WHERE `recDate` = '".inputDate()."'
AND `rec_prod` = 'SME'
AND `rec_proc` = 'Appraisal - TVR'")) {

/* determine number of rows result set */
$row_cnt = $result->num_rows;

printf("<td>%d</td>", $row_cnt);

/* close result set */
$result->close();
}
// end of Mortgage TVR

echo "<td> - </td></tr>";

// End OF SME PRODUCT --------------------------------------------

// START OF Corpbank PRODUCT --------------------------------------------

// Mortgage - Real Estate
if ($result = $con->query("
SELECT `recID`
FROM `samprec`
WHERE `recDate` = '".inputDate()."'
AND `rec_prod` = 'Corpbank'
AND `rec_proc` = 'Appraisal - Real Estate'")) {

/* determine number of rows result set */
$row_cnt = $result->num_rows;

printf("<tr><td>Corpbank</td> <td> %d </td>", $row_cnt);

/* close result set */
$result->close();
}

// end of Mortgage - Real Estate

// Mortgage - TVR
if ($result = $con->query("
SELECT `recID`
FROM `samprec`
WHERE `recDate` = '".inputDate()."'
AND `rec_prod` = 'Corpbank'
AND `rec_proc` = 'Appraisal - TVR'")) {

/* determine number of rows result set */
$row_cnt = $result->num_rows;

printf("<td>%d</td>", $row_cnt);

/* close result set */
$result->close();
}
// end of Mortgage TVR

echo "<td> - </td></tr>";

// End OF Corpbank PRODUCT --------------------------------------------

// START OF Combank PRODUCT --------------------------------------------

// Mortgage - Real Estate
if ($result = $con->query("
SELECT `recID`
FROM `samprec`
WHERE `recDate` = '".inputDate()."'
AND `rec_prod` = 'Combank'
AND `rec_proc` = 'Appraisal - Real Estate'")) {

/* determine number of rows result set */
$row_cnt = $result->num_rows;

printf("<tr><td>Combank</td> <td> %d </td>", $row_cnt);

/* close result set */
$result->close();
}

// end of Mortgage - Real Estate

// Mortgage - TVR
if ($result = $con->query("
SELECT `recID`
FROM `samprec`
WHERE `recDate` = '".inputDate()."'
AND `rec_prod` = 'Combank'
AND `rec_proc` = 'Appraisal - TVR'")) {

/* determine number of rows result set */
$row_cnt = $result->num_rows;

printf("<td>%d</td>", $row_cnt);

/* close result set */
$result->close();
}
// end of Mortgage TVR

echo "<td> - </td></tr>";

// End OF Combank PRODUCT --------------------------------------------

// START OF CCD PRODUCT --------------------------------------------


echo "<tr><td>CCD</td> <td> - </td>";

echo "<td> - </td>";

// CCD - Auto
if ($result = $con->query("
SELECT `recID`
FROM `samprec`
WHERE `recDate` = '".inputDate()."'
AND `rec_prod` = 'CCD'
AND `rec_proc` = 'Appraisal - Auto'")) {

/* determine number of rows result set */
$row_cnt = $result->num_rows;

printf("<td>%d</td></tr>", $row_cnt);

/* close result set */
$result->close();
}
// end of CCD - Auto


// End OF CCD PRODUCT --------------------------------------------

// START OF WAF PRODUCT --------------------------------------------


echo "<tr><td>WAF</td> <td> - </td>";

echo "<td> - </td>";

// WAF - Auto
if ($result = $con->query("
SELECT `recID`
FROM `samprec`
WHERE `recDate` = '".inputDate()."'
AND `rec_prod` = 'WAF'
AND `rec_proc` = 'Appraisal - Auto'")) {

/* determine number of rows result set */
$row_cnt = $result->num_rows;

printf("<td>%d</td></tr>", $row_cnt);

/* close result set */
$result->close();
}
// end of WAF - Auto


// End OF WAF PRODUCT --------------------------------------------

// START OF PhilMay PRODUCT --------------------------------------------


echo "<tr><td>PhilMay</td> <td> - </td>";

echo "<td> - </td>";

// CCD - Auto
if ($result = $con->query("
SELECT `recID`
FROM `samprec`
WHERE `recDate` = '".inputDate()."'
AND `rec_prod` = 'PhilMay'
AND `rec_proc` = 'Appraisal - Auto'")) {

/* determine number of rows result set */
$row_cnt = $result->num_rows;

printf("<td>%d</td></tr>", $row_cnt);

/* close result set */
$result->close();
}
// end of PhilMay - Auto


// End OF PhilMay PRODUCT --------------------------------------------


// Start of Total --------------------------------------------

// Real Estate Total
if ($result = $con->query("
SELECT `recID`
FROM `samprec`
WHERE `recDate` = '".inputDate()."'
AND `rec_proc` = 'Appraisal - Real Estate'")) {

/* determine number of rows result set */
$row_cnt = $result->num_rows;

printf("<tr><td><b>Total</b></td> <td> %d </td>", $row_cnt);

/* close result set */
$result->close();
}

// end of Real Estate Total

// Appraisal - TVR Total
if ($result = $con->query("
SELECT `recID`
FROM `samprec`
WHERE `recDate` = '".inputDate()."'
AND `rec_proc` = 'Appraisal - TVR'")) {

/* determine number of rows result set */
$row_cnt = $result->num_rows;

printf("<td> %d </td>", $row_cnt);

/* close result set */
$result->close();
}

// end of Appraisal - TVR Total

// Appraisal - Auto Total
if ($result = $con->query("
SELECT `recID`
FROM `samprec`
WHERE `recDate` = '".inputDate()."'
AND `rec_proc` = 'Appraisal - Auto'")) {

/* determine number of rows result set */
$row_cnt = $result->num_rows;

printf("<td> %d </td></tr>", $row_cnt);

/* close result set */
$result->close();
}
// end of Appraisal - Auto Total

// End of Total --------------------------------------------

echo "</table>";
?>


</body>

</html>

更新

error.log 显示两个 2 错误

PHP fatal error :无法重新声明 inputDate()(之前已声明)

PHP 注意:常量 TIMEZONE 已经定义

bussvolap.php link .. bussvolci.php link

解决方案

问题在于具有相同的功能,包括连接字符串,以及两个包含页面上的 css 链接。我所做的是删除指向 css、函数(定义相同时区并具有相同函数名称)的链接,并从第二个 Include

中删除连接字符串

最佳答案

这两个包含的文件里面有什么?

如果他们 die() 第一个将停止进一步执行您的脚本。

关于php - 在我的一个页面中有两个 "Include"的问题 - PHP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20455928/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com