当我添加php并在服务器上上传文件时,图像会中断

时间:2014-04-24 16:57:01

标签: css

所以我的所有图片都有正确配置的管理权限等等。他们全部都是777,无论如何都是本地主机。当我创建我的CSS和网站时,它看起来像这样:

http://prntscr.com/3d0lpa

当我添加PhP时,它看起来像这样:

http://prntscr.com/3d0m1m

这是工作代码:

<!DOCTYPE html>
<head>
     <meta http-equiv="content-type" content="text/html; charset=utf-8">

     <title>Follow the white rabbit</title>
     <meta name="description" content="IRC">
     <style>
a:link {color:#FF0000;}    /* unvisited link */
a:visited {color:#00FF00;} /* visited link */
a:hover {color:#FF00FF; }   /* mouse over link */
a:active {color:#0000FF;}  /* selected link */
*{
     padding : 0;
     margin : 0;
     border : 0;
}
body{
     background-image:url('Backgrounds/Matrix.gif');
     opacity:6.6
    }
.kontejner{
     display : block;
     width : 1100px;
     overflow : auto;
     margin : 50px auto 0 auto;
}
.glava{
background-image:url('Logos/logo2.jpg');
background-position:center;
background-repeat: no-repeat;   
     background-color : black;
     float : left;
     clear : none;
     height : 100px;
     width : 994px;
     border: 1px solid green;
     opacity:0.8;
}
.levidiv{
    background-color: black;
     float : left;
     clear : none;
     min-width : 70px;
     min-height : 80px;
     border: 1px solid green;
     opacity:0.8;
}
.levigordiv{
    opacity:0.8;
     background-color: black;
     float : none;
     clear : both;
     height : 250px;
     width : 200px;

}
.vsebina{
    background-image:url('Backgrounds/rabbit.jpg');
    background-position:center;
background-repeat: no-repeat;
     background-color: black;
     float : left;
     clear : none;
     height : 600px;
     width : 592px;
     border: 1px solid green;
     opacity:0.8;
}
.desnidiv{
    background-color: black;
     float : left;
     clear : none;
     min-width : 70px;
     min-height : 80px;
     border: 1px solid green;
     opacity:0.8;

}
.desnigordiv{
     background-color: black;
     float : right;
     clear : both;
     height : 250px;
     width : 197px;
     border-right: 1px solid green;
     opacity:0.8;
}
.noga{
     background-color: black;
     float : left;
     clear : none;
     height : 100px;
     width : 994px;
     opacity:0.8;
     border: 1px solid green;
}
a: hover
{
background-color:red;
}
.meniji
{
color: green;
font-size: 20px;
text-align: center;
}



</style>
</head>
<body>
<div class="kontejner">
      <div class="glava">
      </div>
      <div class="levidiv"><br/><br/><a href=""><p class="meniji">Login</p></a><br/><a href=""><p class="meniji">Register</p></a>
          <div class="levigordiv">
          </div>
      </div>
      <div class="vsebina">
      </div>
      <div class="desnidiv"><br/><br/><a href=""><p class="meniji">IRC</p></a><br/><a href=""><p class="meniji">Scan</p></a>
          <div class="desnigordiv">
          </div>
      </div>
      <div class="noga"><br/><br/><a href=""><p class="meniji">Home</p></a>
      </div>
</div>
</body>
</html>

这是无效的代码:

布局:

<!DOCTYPE html>
<head>
     <meta http-equiv="content-type" content="text/html; charset=utf-8">

     <title>Follow the white rabbit</title>
     <meta name="description" content="IRC">
     <style>
a:link {color:#FF0000;}    /* unvisited link */
a:visited {color:#00FF00;} /* visited link */
a:hover {color:#FF00FF; }   /* mouse over link */
a:active {color:#0000FF;}  /* selected link */
*{
     padding : 0;
     margin : 0;
     border : 0;
}
body{
     background-image:url('Backgrounds/Matrix.gif');
     opacity:6.6
    }
.kontejner{
     display : block;
     width : 1100px;
     overflow : auto;
     margin : 50px auto 0 auto;
}
.glava{
background-image:url('Logos/logo2.jpg');
background-position:center;
background-repeat: no-repeat;   
     background-color : black;
     float : left;
     clear : none;
     height : 100px;
     width : 994px;
     border: 1px solid green;
     opacity:0.8;
}
.levidiv{
    background-color: black;
     float : left;
     clear : none;
     min-width : 70px;
     min-height : 80px;
     border: 1px solid green;
     opacity:0.8;
}
.levigordiv{
    opacity:0.8;
     background-color: black;
     float : none;
     clear : both;
     height : 250px;
     width : 200px;

}
.vsebina{
    background-image:url('Backgrounds/rabbit.jpg');
    background-position:center;
background-repeat: no-repeat;
     background-color: black;
     float : left;
     clear : none;
     height : 600px;
     width : 592px;
     border: 1px solid green;
     opacity:0.8;
}
.desnidiv{
    background-color: black;
     float : left;
     clear : none;
     min-width : 70px;
     min-height : 80px;
     border: 1px solid green;
     opacity:0.8;

}
.desnigordiv{
     background-color: black;
     float : right;
     clear : both;
     height : 250px;
     width : 197px;
     border-right: 1px solid green;
     opacity:0.8;
}
.noga{
     background-color: black;
     float : left;
     clear : none;
     height : 100px;
     width : 994px;
     opacity:0.8;
     border: 1px solid green;
}
a: hover
{
background-color:red;
}
.meniji
{
color: green;
font-size: 20px;
text-align: center;
}



</style>
</head>
<body>
<div class="kontejner">
      <div class="glava">
      </div>
      <div class="levidiv"><br/><br/><a href=""><p class="meniji">Login</p></a><br/><a href=""><p class="meniji">Register</p></a>
          <div class="levigordiv">
          </div>
      </div>
      <div class="vsebina">  <?php echo $content; ?>
      </div>
      <div class="desnidiv"><br/><br/><a href=""><p class="meniji">IRC</p></a><br/><a href=""><p class="meniji">Scan</p></a>
          <div class="desnigordiv">
          </div>
      </div>
      <div class="noga"><br/><br/><a href=""><p class="meniji">Home</p></a>
      </div>
</div>
</body>
</html>

index.html.php

<?php ob_start() ?>

<p>Hello.</p>


<?php $content = ob_get_clean() ?>

<?php ob_start() ?>
Glavna stran
<?php $title = ob_get_clean() ?>
<?php require 'layout.html.php' ?>

的index.php

<?php

if(isset($_GET['stran']) && $_GET['stran']=='login')
{
    include 'Templates/Login/login.html.php';
}
else
{
    include 'Templates/index.html.php';
}


?>

这是文件夹的放置方式:

http:/ / prntscr。 com / 3d0nzd

index.php只是一个文件夹。

- UPDATE -

我认为问题出在index.php中。如果没有这个索引,我的布局和图像就能完美运行!!!

0 个答案:

没有答案