Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP、HTML和CSS的页面布局问题_Php_Html_Css_Formatting - Fatal编程技术网

PHP、HTML和CSS的页面布局问题

PHP、HTML和CSS的页面布局问题,php,html,css,formatting,Php,Html,Css,Formatting,由于某些原因,我的CSS没有将div标记格式化到页面上的正确位置。它可以在我所有的其他页面上运行,但是这个页面中的PHP比普通页面多得多,我想知道这是否是问题所在。 页面 页面加载后的源 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.

由于某些原因,我的CSS没有将div标记格式化到页面上的正确位置。它可以在我所有的其他页面上运行,但是这个页面中的PHP比普通页面多得多,我想知道这是否是问题所在。 页面

页面加载后的源

<!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 content="text/html; charset=utf-8" http-equiv="Content-Type" />

<title>Untitled 1</title>

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

</head>



<body>

Wrong Username or Password

</body>



</html>

无标题1
错误的用户名或密码

这是因为如果有用户,包装器才刚刚启动。。 但是如果将包装器放在PHP上会发生什么,比如:

<!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 content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="wrapper">
        <?php
        require("protect/serverInfo.php");
        $myusername=$_POST[Email]; 
        $mypassword=$_POST[Password];
        $result = mysql_query("SELECT * FROM Customers WHERE Email='$myusername' AND Password=$mypassword");
        $count=mysql_num_rows($result);
        if($count==1){
            while($row = mysql_fetch_array($result)){
            ?>

                <div class="customerHead">';
                    <h1>  
                        <?php echo $row['Customer'] ?> 
                    </h1>
                </div>
                <div class="customerInfoMain">
                     Company: <?php echo $row['Company'] ?><br />
                      State: <?php echo $row['State'] ?>
                </div>  
                <div class="customerCards">';
                     <a href ="something/<?php echo $row['imagePathFront'] ?>" target="_blank"><img src="<?php echo $row['imagePathFront'] ?>" width="400px" height="303px" align="center" alt="" /></a>
                     <a href ="something/<?php echo $row['imagePathBack'] ?>" target="_blank"><img src="<?php echo $row['imagePathBack'] ?>" width="400px" height="303px" align="center" alt="" /></a>
                </div>  
                <div class="customerComments">';
                    <h5>Changes Made:</h5><br /> <?php echo $row['Comments'] ?> 
                </div>

        <?php   
            }
        }
        else {
            echo "Wrong Username or Password";
        }
        ?>
    </div>
</body>
</html>

无标题1

这是因为如果有用户,包装器才刚刚启动。。 但是如果将包装器放在PHP上会发生什么,比如:

<!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 content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="wrapper">
        <?php
        require("protect/serverInfo.php");
        $myusername=$_POST[Email]; 
        $mypassword=$_POST[Password];
        $result = mysql_query("SELECT * FROM Customers WHERE Email='$myusername' AND Password=$mypassword");
        $count=mysql_num_rows($result);
        if($count==1){
            while($row = mysql_fetch_array($result)){
            ?>

                <div class="customerHead">';
                    <h1>  
                        <?php echo $row['Customer'] ?> 
                    </h1>
                </div>
                <div class="customerInfoMain">
                     Company: <?php echo $row['Company'] ?><br />
                      State: <?php echo $row['State'] ?>
                </div>  
                <div class="customerCards">';
                     <a href ="something/<?php echo $row['imagePathFront'] ?>" target="_blank"><img src="<?php echo $row['imagePathFront'] ?>" width="400px" height="303px" align="center" alt="" /></a>
                     <a href ="something/<?php echo $row['imagePathBack'] ?>" target="_blank"><img src="<?php echo $row['imagePathBack'] ?>" width="400px" height="303px" align="center" alt="" /></a>
                </div>  
                <div class="customerComments">';
                    <h5>Changes Made:</h5><br /> <?php echo $row['Comments'] ?> 
                </div>

        <?php   
            }
        }
        else {
            echo "Wrong Username or Password";
        }
        ?>
    </div>
</body>
</html>

无标题1

按目的拆分代码功能和计算不应位于同一位置,html应最后呈现。继续这样工作会给你带来很多麻烦。应该这样做:

loginProcess.php包含: 如果(isset($\u会话[“用户”]){ $row=$\会话[“用户”]; } 包括(“loginPage.php”); ?>

这是longinPage.php(您可以将其中任何一个包含在您想要的内容中)。在loginproces.php的末尾包含loginPage.php,或者在loginPage.php的开头包含loginproces.php

因此loginPage.php包含

<!DOCTYPE html PUBLIC“-//W3C//DTD XHTML 1.0//EN”http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

无标题1

如果(isset($_会话['user']){


按目的拆分代码功能和计算不应该在同一个位置,html应该最后呈现。继续这样工作会给您带来很多麻烦。应该这样做:

loginProcess.php包含: 如果(isset($\u会话[“用户”]){ $row=$\会话[“用户”]; } 包括(“loginPage.php”); ?>

这是longinPage.php(您可以将其中任何一个包含在您想要的内容中)。在loginproces.php的末尾包含loginPage.php,或者在loginPage.php的开头包含loginproces.php

因此loginPage.php包含

<!DOCTYPE html PUBLIC“-//W3C//DTD XHTML 1.0//EN”http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

无标题1

如果(isset($_会话['user']){


PHP在服务器端运行,并且永远不会出现在输出中。您需要查看生成的HTML(并可能在此处发布)我在页面加载后发布了页面源代码。您发布的标记上没有CSS可处理的内容。好吧,这里的身份验证失败,这就是为什么您没有看到您的CSS魔术发挥作用。好吧,您已经发布了由
else
生成的内容,我们应该如何理解它?PHP在服务器端运行,并且输出中从不出现。您需要查看生成的HTML(可能会在此处发布)我在页面加载后发布了页面源代码。您发布的标记上没有CSS可处理的内容。好吧,身份验证失败,这就是为什么您没有看到您的CSS魔力发挥作用的原因。好吧,您已经发布了由
else
生成的内容,我们应该如何理解这一点?
<!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 content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
<link href="stylesheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div class="wrapper">
        <?php
        require("protect/serverInfo.php");
        $myusername=$_POST[Email]; 
        $mypassword=$_POST[Password];
        $result = mysql_query("SELECT * FROM Customers WHERE Email='$myusername' AND Password=$mypassword");
        $count=mysql_num_rows($result);
        if($count==1){
            while($row = mysql_fetch_array($result)){
            ?>

                <div class="customerHead">';
                    <h1>  
                        <?php echo $row['Customer'] ?> 
                    </h1>
                </div>
                <div class="customerInfoMain">
                     Company: <?php echo $row['Company'] ?><br />
                      State: <?php echo $row['State'] ?>
                </div>  
                <div class="customerCards">';
                     <a href ="something/<?php echo $row['imagePathFront'] ?>" target="_blank"><img src="<?php echo $row['imagePathFront'] ?>" width="400px" height="303px" align="center" alt="" /></a>
                     <a href ="something/<?php echo $row['imagePathBack'] ?>" target="_blank"><img src="<?php echo $row['imagePathBack'] ?>" width="400px" height="303px" align="center" alt="" /></a>
                </div>  
                <div class="customerComments">';
                    <h5>Changes Made:</h5><br /> <?php echo $row['Comments'] ?> 
                </div>

        <?php   
            }
        }
        else {
            echo "Wrong Username or Password";
        }
        ?>
    </div>
</body>
</html>
    < div class="wrapper">

        < div class="customerHead">';

            <h1><!---you know the row from before---/>  

                <?php echo $row['Customer'] ?> 

            </h1>

        </div>

        <div class="customerInfoMain">

             Company: <?php echo $row['Company'] ?><br />
              State: <?php echo $row['State'] ?>

        </div>  
        <div class="customerCards">';

             <a href ="something/<?php echo $row['imagePathFront'] ?>" target="_blank"><img src="<?php echo $row['imagePathFront'] ?>" width="400px" height="303px" align="center" alt="" /></a>

             < a href ="something/<?php echo $row['imagePathBack'] ?>" target="_blank">
        </div>  

        <div class="customerComments">';

            <h5>Changes Made:</h5><br /> <?php echo $row['Comments'] ?> 

        </div>

    </div>

<?php   

    }

}
else {?>
     <form action="/loginProcess.php" (or loginPage.php if loginPage includes the loginProcess) method="POST">
            <input type="text" name="Email" value=""/>
            <input type="password" name="Password" value=""/>
            <input type="submit" value="login"/>
       </form>
<?php}?>