Php 所有页面的布局都相同
我是网络开发新手。我想在其他页面中使用此索引页面布局。所以我做了这个代码。现在,当索引页面打开时,我得到了包含在php中的表的完美布局。但当我点击这本旧书时,它被重定向到“1.php”,但布局保持不变,表并没有被替换。我已经附上了截图现在我想那本书显示部分应该取代在每一个其他重定向页面,但我没有得到这个代码请建议我编辑在这个代码Php 所有页面的布局都相同,php,html,Php,Html,我是网络开发新手。我想在其他页面中使用此索引页面布局。所以我做了这个代码。现在,当索引页面打开时,我得到了包含在php中的表的完美布局。但当我点击这本旧书时,它被重定向到“1.php”,但布局保持不变,表并没有被替换。我已经附上了截图现在我想那本书显示部分应该取代在每一个其他重定向页面,但我没有得到这个代码请建议我编辑在这个代码 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cz"> <head>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="cz">
<head>
<style>
ul {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
background-color: #ff3333;
}
li {
float: left;
}
li a {
display: block;
color: white;
text-align: center;
padding: 14px 16px;
text-decoration: none;
}
li a:hover {
background-color: #ff8080;
}
</style>
<style>
body
{
background-image: url("back.jpg");
background-position:0px 0px;
background-size: cover;
background-repeat: repeat;
}
</style>
<style>
.center {
margin: auto;
width: 60%;
padding: 100px;
}
</style>
</head>
<body>
<style>
table{
border-spacing:15px;
}
td{
padding:30px;
}
body
{
background-image: url(back.jpg);
background-position:0px 0px;
background-attachment:fixed;
background-size: cover;
background-repeat: repeat;
}
</style>
<div class="center">
<ul>
<li><a class="active" href="?page=home">NewBooks</a></li>
<li><a href="index.php?con=1">OldBooks</a></li>
<li><a href="#contact">Rent a book</a></li>
<li><a href="#about">Feedback</a></li>
</ul>
<div id="RightPart">
<?php
$con;
require "connect.php";
$sql="select * from nbook";
$row = $conn->query($sql);
$n=0;
echo"<form method='post'><table border='0' align='center'><tr>";
while($arr = $row->fetch_assoc())
{
$i=$arr['BookId'];
if($n%3==0)
{
echo "<tr>";
}
echo "
<td height='280' width='240' align='center'><img src='data:image/jpg;base64,".base64_encode( $arr['BookImage'] )."'height='250' width='200'><br/>
<b>BOOKNAME:</b>".$arr['BOOKNAME']."
<br><b>Author:</b>".$arr['Author']."
<br><b>Publication:</b> ".$arr['PublicatonHouse']."
<br><b>Discount:</b>".$arr['Discount']."%
<br><br><a href='buy.php?con=11& itemno=$i'><img src='images/MetalPlakDa5new.gif' width='70' height='20'/></a>
<a href='index.php?con=11'><img src='images/view7.jpg' width='70' height='20'/></a>
</td>";
$n++;
}
echo "</tr></table>
</form>";
if($_REQUEST['con']==1)
{
include("1.php");
}
error_reporting(1);
include("index1.php");
?>
<div class="cleaner"></div>
</div>
<div id="Bottom">
<p class="down"><b>Copyright © VJTI BOOK SHOP by:VJTI</b></p>
</div>
</div>
</div>
</body>
</html>
保险商实验室{
列表样式类型:无;
保证金:0;
填充:0;
溢出:隐藏;
背景色:#ff3333;
}
李{
浮动:左;
}
李阿{
显示:块;
颜色:白色;
文本对齐:居中;
填充:14px 16px;
文字装饰:无;
}
李娜:停下来{
背景色:#ff8080;
}
身体
{
背景图片:url(“back.jpg”);
背景位置:0px 0px;
背景尺寸:封面;
背景重复:重复;
}
.中心{
保证金:自动;
宽度:60%;
填充:100px;
}
桌子{
边界间距:15px;
}
运输署{
填充:30px;
}
身体
{
背景图片:url(back.jpg);
背景位置:0px 0px;
背景附件:固定;
背景尺寸:封面;
背景重复:重复;
}
版权和副本;VJTI书店作者:VJTI
更好的方法是,分别编写header.php、sidebar.php和footer.php
然后按以下顺序将它们包含在每个页面中:
<?php
include("header.php");
include("sidebar.php");
?>
.............
.............
Here goes individual page's HTML content followed by
..............
..............
<?php
include("footer.php");
?>
.............
.............
下面是单独页面的HTML内容,后面是
..............
..............
更好的方法是,分别编写header.php、sidebar.php和footer.php
然后按以下顺序将它们包含在每个页面中:
<?php
include("header.php");
include("sidebar.php");
?>
.............
.............
Here goes individual page's HTML content followed by
..............
..............
<?php
include("footer.php");
?>
.............
.............
下面是单独页面的HTML内容,后面是
..............
..............
要有一个格式良好的页面,最好花一点时间学习简单而现代的PHP模板引擎,像英雄一样开始你的职业生涯:)要有一个格式良好的页面,最好花一点时间学习简单而现代的PHP模板引擎,像英雄一样开始你的职业生涯:)