PHP代码跳过一些HTML内容

时间:2016-01-22 17:23:05

标签: php amazon-web-services

我的PHP代码在本地服务器上运行正常,但不在Web服务器上执行 一些代码正在运作。 代码被放下,请告诉我代码的问题。

<?php
include("/connect.php");
session_start();
$_SESSION['title']="Portfolio | Mactros Inc.";
include("header.php");
?>
    <div>
        <center>
            <font size=7 class="top">
                Portfolio<br />
            </font>
            <font style="color: #aeafb1;"><a href="index.php" style="color: #aeafb1;">Home</a> -> Portfolio</font>
        </center>       
    </div>
    <div style="height: 650px; margin-top: 10px;">
        <?php
            $sql = "select * from project";
            $result = $conn->query($sql);
            while($row = $result->fetch_assoc()){
        ?>    
        <div class="portfolio">
            <center>
                <img src="<?php echo $row["pic"]; ?>" class="port">
                <font size=5><?php echo $row["name"];?></font><br>
                <font><?php echo $row["type"];?></font>
            </center>
        </div>
       <?php }?>
    </div><?php    include("footer.php");?>

在此代码中执行其他被忽略的

<?php
include("/connect.php");
session_start();
$_SESSION['title']="Portfolio | Mactros Inc.";
include("header.php");
?>  <div>
        <center>
            <font size=7 class="top">
                Portfolio<br />
            </font>
            <font style="color: #aeafb1;"><a href="index.php" style="color: #aeafb1;">Home</a> -> Portfolio</font>

2 个答案:

答案 0 :(得分:2)

include("/connect.php");

这是一个绝对路径,我不认为你的脚本位于文件系统的根目录,而是使用相对路径,并且不禁用错误。

答案 1 :(得分:0)

将这行代码写在脚本文件的顶部,以显示脚本中发生的错误。

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/container"
    android:layout_centerInParent="true"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:clickable="true"
    android:background="@drawable/animated_bg">

    <RelativeLayout>

        <RelativeLayout>

            <ImageView />

            <LinearLayout>

                <TextView />

                <TextView />

            </LinearLayout>

        </RelativeLayout>

        <LinearLayout >

            <LinearLayout >

                <RelativeLayout >

                    <ImageView />

                    <TextView />

                    <TextView />

                    <TextView />

                </RelativeLayout>

                <RelativeLayout >

                    <ImageView />

                    <TextView />

                    <TextView />

                </RelativeLayout>

            </LinearLayout>

            <LinearLayout >

                <RelativeLayout >

                    <TextView />

                </RelativeLayout>
            </LinearLayout>
        </LinearLayout>

    </RelativeLayout>

</RelativeLayout>