0

我最近将所有 html 页面更改为 .php 页面,用于新的包含页眉和页脚以及导航。这是我第一次尝试使用 php 语言,我很难理解它如何影响我之前页面上已有的 html 代码。

我遇到的一个问题是我现在不再滑动的简单图片幻灯片。它只是停在第一张图片上,而不是旋转 4 张图片。

我是否必须添加新的 php 语言才能使其再次工作?有谁知道下面的 php 编码阻止了它的工作?

php头代码如下:

 <?php
require_once("calendar/includes/config.php");

$db_connection = mysql_connect ($DBHost, $DBUser, $DBPass) OR die (mysql_error());  
$db_select = mysql_select_db ($DBName) or die (mysql_error());
$db_table = $TBL_PR . "events";

$query = "SELECT * FROM calendar_category WHERE status=1";

$query_result = mysql_query($query);

while($query_fetch = mysql_fetch_array($query_result)){
    if(empty($andcat)) $andcat = " (`category` = $query_fetch[0] OR `category` LIKE '$query_fetch[0],%' OR `category` LIKE '%,$query_fetch[0],%' OR `category` LIKE '%,$query_fetch[0]')";
    else $andcat .= " OR (`category` = $query_fetch[0] OR `category` LIKE '$query_fetch[0],%' OR `category` LIKE '%,$query_fetch[0],%' OR `category` LIKE '%,$query_fetch[0]')";
}


$query2 = "SELECT * FROM $db_table where STR_TO_DATE(concat(event_day,',',event_month,',',event_year),'%d,%m,%Y') >= curdate() AND (".$andcat." )
order by STR_TO_DATE(concat(event_day,',',event_month,',',event_year),'%d,%m,%Y') LIMIT 3";

$query_result2 = mysql_query($query2);


?>

<!DOCTYPE html>

<html lang="en">

<head>

    <title>Creative Minds International PCS</title>

    <meta charset="utf-8">

    <meta name="description" content="Your description">

    <meta name="keywords" content="Your keywords">

    <meta name="author" content="Your name">

    <link rel="stylesheet" href="css/style.css">

    <link href='http://fonts.googleapis.com/css?family=Vollkorn' rel='stylesheet' type='text/css'>

    <script src="site/js/jquery-1.6.4.min.js"></script>

    <script src="site/js/script.js"></script>

    <script src="site/js/flashobject.js"></script>

    <!--[if lt IE 7]>

        <div class='aligncenter'><a href="http://www.microsoft.com/windows/internet-explorer/default.aspx?ocid=ie6_countdown_bannercode"><img src="http://storage.ie6countdown.com/assets/100/images/banners/warning_bar_0000_us.jpg"border="0"></a></div>  

    <![endif]-->

    <!--[if lt IE 9]>

        <script src="js/html5.js"></script>

        <link rel="stylesheet" href="css/ie.css"> 

    <![endif]-->

    <script type="text/javascript">

<!--

var image1=new Image()

image1.src="../slideshow3.jpg" 

var image2=new Image()

image2.src="../slideshow2.jpg"

var image3=new Image()

image3.src="../slideshow4.jpg"

var image4=new Image()

image4.src="../slideshow1.jpg"

//-->

</script>

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-28106351-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
    </head>


<body id="page2">



<div class="main-bg">

<header><?php include('includes/header.php'); ?>   

    <div class="nav-container" >
<navigation><?php include('includes/nav.php'); ?>      



            <div class="clear"></div>

            </div>


                 <div class="flash" >

                    <div id="head">

                    <div class="aligncenter"><img src="slideshow3.jpg"  alt="Creative Minds Slideshow" width="990" height="450" id="Slideshow">   <script>

        <!--

        //variable that will increment through the images

        var step=1

        function slideit(){

        //if browser does not support the image object, exit.

        if (!document.images)

        return

        document.images.slide.src=eval("image"+step+".src")

        if (step<4)

        step++

        else

        step=1

        //call function "slideit()" every 2.5 seconds

        setTimeout("slideit()",6000)

        }

        slideit()

        //-->

        </script>             

        </div></div>

    </div>  

</header>
4

1 回答 1

0

做两件事:

  1. 检查您的 Apache 错误日志以查找隐藏的错误
  2. 删除文档类型前的空格:更改

    ?>

    < !DOCTYPE html>

?><!DOCTYPE html>
于 2012-06-12T01:16:52.297 回答