Php 我的网站的页脚';的主页不是';不来
我一直在努力做一个网站。这是一个在线购物网站 这是我的密码-Php 我的网站的页脚';的主页不是';不来,php,html,Php,Html,我一直在努力做一个网站。这是一个在线购物网站 这是我的密码- <?php session_start(); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>Books And Beyond</title> <meta name="viewpor
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Books And Beyond</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Bootstrap styles open source -->
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet" crossorigin="anonymus">
<!-- Customize styles -->
<link href="style.css" rel="stylesheet"/>
<!-- font awesome styles open source -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" crossorigin="anonymus">
<!-- Favicons -->
<link rel="shortcut icon" href="/favicon.ico">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"><style
type="text/css">
<!--
body {
background-image: url(assets/img/background.jpg);
}
-->
</style></head>
<body>
<!--
Upper Header Section
-->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="topNav">
<div class="container">
<div class="alignR">
<?php if (isset($_SESSION['email'])) { echo $_SESSION['email']; } else { ?>
<ul class="nav pull-right">
<li class="dropdown">
<a data-toggle="dropdown" class="dropdown-toggle" href="#"><span class="icon-lock"></span> Login <b class="caret"></b></a>
<div class="dropdown-menu">
<form class="form-horizontal loginFrm" action="checkuser.php" method="post">
<div class="control-group">
<input name="email" type="text" class="span2" id="email" placeholder="Email">
</div>
<div class="control-group">
<input name="password" type="password" class="span2" id="password" placeholder="Password">
</div>
<div class="control-group">
<label class="checkbox">
<input type="checkbox"> Remember me
</label>
<button name="login" type="submit" class="shopBtn btn-block">Sign in</button>
</div>
</form>
</div>
</li>
</ul>
<?php } ?>
<?php if (isset($_SESSION['email'])) { ?>
<a href="logout.php"> Logout </a>
<?php } else { ?>
<a href="register.php"><span class="icon-edit"></span> Register </a>
<?php }?>
</div>
</div>
</div>
</div>
<!--
Lower Header Section
-->
<div class="container">
<div id="gototop"> </div>
<header id="header">
<div class="row">
<div class="span4">
<h1>
<a class="logo" href="index.php"><span>Books And Beyond</span>
<img src="assets/img/logo1.jpg" alt="" width="218" height="94"> </a> </h1>
</div>
</div>
</header>
<!--
Navigation Bar Section
-->
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<div class="nav-collapse">
<ul class="nav">
<li class="active"><a href="index.php">Home</a></li>
<li class=""><a href="about.php">About</a></li>
<li class=""><a href="bargain.php">Bargain Books</a></li>
<li class=""><a href="new.php">New Releases</a></li>
<li class=""><a href="best.php">Bestsellers</a></li>
<li class=""><a href="contact.php">Contact Us</a></li>
</ul>
<ul class="nav pull-right">
</ul>
</div>
</div>
</div>
</div>
<div class="row">
<div class="span12">
<img src="assets/img/banner.jpg"/>
<hr class="soften"/>
</div>
</div>
<!--Body Section
-->
<div class="row">
<div id="sidebar" class="span3">
<div class="well well-small">
<h3> Category </h3>
<ul class="nav nav-list">
<li><a href="fiction.php"><span class="icon-chevron-right"></span>Fiction</a></li>
<li><a href="nonfiction.php"><span class="icon-chevron-right"></span>Non-Fiction</a></li>
<li><a href="young.php"><span class="icon-chevron-right"></span>Young Adult</a></li>
<li><a href="children.php"><span class="icon-chevron-right"></span>Children's</a></li>
<li><a href="travel.php"><span class="icon-chevron-right"></span>Travel</a></li>
<li><a href="education.php"><span class="icon-chevron-right"></span>Education</a></li>
<li style="border:0"> </li>
</ul>
</div>
<!--<div class="well well-small alert alert-warning cntr">
<h2>50% Discount</h2>
<p>
only valid for online order. <br><br><a class="defaultBtn" href="#">Click here </a>
</p>
</div>-->
<!-- <div class="well well-small" ><a href="#"><img src="assets/img/paypal.jpg" alt="payment method paypal"></a></div>-->
<!--<a class="shopBtn btn-block" href="#">Upcoming products <br><small>Click to view</small></a>-->
<ul class="nav nav-list promowrapper">
<?php
/* require_once('dbconnect.php'); */
$result = mysql_query("SELECT * from product WHERE brand='accessories'");
while ($row = mysql_fetch_array($result))
{
$intproductid=$row["id"];
$price=$row["productprice"];
$productimage=$row["productimage"];
?>
<li>
<div class="thumbnail">
<img width="200" height="80" src="getImage.php?intproductid=<?php print $intproductid;?>" />
<div class="caption">
<table width="250" border="0">
<tr>
<td align="left" valign="middle"><form action="product_detail.php" method="post" name="form2" id="form2">
<label>
<input type="hidden" name="intproductid2" value="<?php echo $intproductid; ?>" />
<input name="Submit2" type="submit" class="shopBtn" value="View" />
</label>
</form></td>
<td align="right" valign="middle"><h4> <span class="pull-right"><?php echo $price; ?>.00</span></h4></td>
</tr>
</table>
</div>
</div>
</li>
<li style="border:0"> </li>
<?php } ?>
</ul>
</div>
<div class="span9">
<!--
New Products
-->
<div class="well well-small">
<h3>New Products </h3>
<hr class="soften"/>
<div class="row-fluid">
<div id="newProductcar" class="carousel slide">
<div class="">
<div class="item active">
<ul class="thumbnails">
<?php
require_once('dbconnect.php');
$result = mysql_query("SELECT * from product WHERE brand='bousni' LIMIT 1");
while ($row = mysql_fetch_array($result))
{
$intproductid=$row["id"];
//$productimage=$row["productimage"];
?>
<li class="span3">
<div class="thumbnail">
<a href="#" class="tag"></a>
<img width="200" height="120" src="getImage.php?intproductid=<?php print $intproductid;?>" />
</div>
</li>
<?php } ?>
<?php
require_once('dbconnect.php');
$result = mysql_query("SELECT * from product WHERE brand='hela couture' LIMIT 1");
while ($row = mysql_fetch_array($result))
{
$intproductid=$row["id"];
//$productimage=$row["productimage"];
?>
<li class="span3">
<div class="thumbnail">
<a href="#" class="tag"></a>
<img width="200" height="120" src="getImage.php?intproductid=<?php print $intproductid;?>" />
</div>
</li>
<?php } ?>
<?php
require_once('dbconnect.php');
$result = mysql_query("SELECT * from product WHERE brand='zey' LIMIT 1");
while ($row = mysql_fetch_array($result))
{
$intproductid=$row["id"];
//$productimage=$row["productimage"];
?>
<li class="span3">
<div class="thumbnail">
<a href="#" class="tag"></a>
<img width="200" height="120" src="getImage.php?intproductid=<?php print $intproductid;?>" />
</div>
</li>
<?php } ?>
<?php
require_once('dbconnect.php');
$result = mysql_query("SELECT * from product WHERE brand='AL-JUMAIRA' LIMIT 1");
while ($row = mysql_fetch_array($result))
{
$intproductid=$row["id"];
//$productimage=$row["productimage"];
?>
<li class="span3">
<div class="thumbnail">
<a href="#" class="tag"></a>
<img width="200" height="120" src="getImage.php?intproductid=<?php print $intproductid;?>" />
</div>
</li>
<?php } ?>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="well well-small">
<div class="span8">
<div class="row-fluid">
<h3>Features Products </h3>
<hr class="soften"/>
<ul class="thumbnails">
<?php
require_once('dbconnect.php');
$result = mysql_query("SELECT * from product WHERE brand='roza' LIMIT 3");
while ($row = mysql_fetch_array($result))
{
$intproductid=$row["id"];
$productname=$row["productname"];
$brand=$row["brand"];
$price=$row["productprice"];
$productimage=$row["productimage"];
?>
<li class="span4">
<div class="thumbnail">
<img width="250" height="120" src="getImage.php?intproductid=<?php print $intproductid;?>" />
<div class="caption cntr">
<p style="color:#990033"><?php echo $productname; ?></p>
<p><?php echo $brand; ?></p>
<p><strong>SAR <?php echo $price; ?>.00</strong></p>
<div class="btn-group">
<form id="form2" name="form2" method="post" action="product_detail.php">
<label>
<input type="hidden" name="intproductid2" value="<?php echo $intproductid; ?>" />
<input name="Submit2" type="submit" class="shopBtn" value="View" />
<input name="Submit2" type="submit" class="defaultBtn" value="Add to cart" />
</label>
</form>
</div>
<br class="clr">
</div>
</div>
</li>
<?php } ?>
</ul>
<hr class="soften"/>
<ul class="thumbnails">
<?php
require_once('dbconnect.php');
$result = mysql_query("SELECT * from product WHERE brand='haya' LIMIT 3");
while ($row = mysql_fetch_array($result))
{
$intproductid=$row["id"];
$productname=$row["productname"];
$brand=$row["brand"];
$price=$row["productprice"];
$productimage=$row["productimage"];
?>
<li class="span4">
<div class="thumbnail">
<img width="250" height="120" src="getImage.php?intproductid=<?php print $intproductid;?>" />
<div class="caption cntr">
<p style="color:#990033"><?php echo $productname; ?></p>
<p><?php echo $brand; ?></p>
<p><strong>SAR <?php echo $price; ?>.00</strong></p>
<div class="btn-group">
<form id="form2" name="form2" method="post" action="product_detail.php">
<label>
<input type="hidden" name="intproductid2" value="<?php echo $intproductid; ?>" />
<input name="Submit2" type="submit" class="shopBtn" value="View" />
<input name="Submit2" type="submit" class="defaultBtn" value="Add to cart" />
</label>
</form>
</div>
<br class="clr">
</div>
</div>
</li>
<?php } ?>
</ul>
</div>
</div>
<div class="row">
</div>
</div>
</div></div></div>
<!--
Footer
-->
<footer class="footer" style="float: bottom;">
<div class="row-fluid">
<div class="span3">
<h5>ORDER SUPPORT</h5>
<a href="contact.php">Store pickup</a><br>
<a href="return.php">Return and Refund</a><br>
</div>
<div class="span3">
<h5>PRODUCT SUPPORT</h5>
<a href="faqs.php">FAQs</a><br>
<a href="inquiry.php">Inquiry</a><br>
</div>
<div class="span3">
<h5>COOPORATIVE INFO</h5>
<a href="terms.php">Terms and Condition</a> <br>
<a href="contact.php">Contact us</a><br>
</div>
<div class="span3">
<h5>GET CONNECTED</h5>
<a href="about.php">About us</a> <br>
<a href="register.php">Create Account</a><br>
</div>
</div>
</footer>
</div><!-- /container -->
<div class="copyright">
<div class="container">
<p class="pull-right"> </p>
<span>Copyright 2019, Fatimatuz Johura - s201403034- Jeddah (Ladies Branch);<br> Books And Beyond</span>
</div>
</div>
<script src="assets/js/jquery.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/jquery.easing-1.3.min.js"></script>
<script src="assets/js/jquery.scrollTo-1.4.3.1-min.js"></script>
<script src="assets/js/shop.js"></script>
</body>
</html>
书籍及其他
-
记得我吗
登录
类别
在线152(新产品在线~185[ish])
正如我在评论中所说,您使用这个
require_once('dbconnect.php')代码>多次,但它应该只在文件顶部显示一次
上面的代码是我能找到的第一个实例,正如它被注释掉的那样,这个查询将轰炸你。执行从上到下进行,第一个未提交的查询出现在第196行[ish],这对于第一个查询来说太晚了
正如我在评论中所说
尝试打开错误报告-错误报告(-1)代码>和ini_集('display_errors','1')
把它们放在后面,我猜你在那里的某个地方有语法错误,当PHP和HTML混合在这个级别时很难分辨。因此,使用诸如twig
或blade
等模板引擎的原因……我认为关键在于查看生成的源HTML并查看其停止位置。这可能是您的PHP开始出现缺陷的地方<代码>$productimage=$row[“productimage”];--第159行,$productimage=$row[“productimage”];--第284行
和$productimage=$row[“productimage”];--第322行
都是一样的,这很奇怪。@AaronHolland-这是一个好主意,我们确实有这个提示,新产品和页脚部分不会出现
但是。我能想到的最好情况是你有一个DB错误,你多次使用这个require_一次('dbconnect.php')
当您只需要它一次,但第一次使用它是在新产品开始之后
。。。。尝试打开错误报告-错误报告(-1)代码>和ini_集('display_errors','1')代码>把它们放在后面,我试着这样做,但是页面没有出现。我再次尝试了我的代码(上面的代码),但没有删除“db connect”代码,这就是页脚的位置-致命错误:未捕获错误:调用C:\xampp\htdocs\bab\dbconnect.php中未定义的函数mysql_connect()。php:3堆栈跟踪:#0 C:\xampp\htdocs\bab\index.php(153):require_once()#1{main}在第3行的C:\xampp\htdocs\bab\dbconnect.php中抛出这是我的数据库连接代码。我觉得它很好,但我不知道它出了什么问题调用未定义的函数mysql\u connect()
从PHP7开始,整个mysql\u
函数家族都将被删除,因此如果您想使用它们。您需要找到与PHP7兼容的mysql\uuu
扩展,以便打开它们。或者您需要降低PHP版本的级别,或者更好地使用现代标准,如数据库的mysqli_quot/code>或PDO
。由于各种原因,它们被删除了,其中一个原因是它们缺乏准备好的语句,并且缺乏针对SQLInjection攻击的安全性。
/* require_once('dbconnect.php'); */
$result = mysql_query("SELECT * from product WHERE brand='accessories'");