我被困住了,我很绝望。这是问题所在:
我有一个包含所有其他 div 的 div“容器”。但不知何故,div 以第一个 php 语句的位置结束!我说的是魔法。我希望容器 div 保存整个页面,但它到达第一个 php 语句(将另一个文件中的代码包含到页面中)并结束。我找不到原因。
代码。
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>{subTITLE}<?php echo TITLE; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<meta http-equiv="description" content="{subDESCRIPTION}<?php echo DESCRIPTION; ?>">
<meta http-equiv="keywords" content="<?php echo KEYWORDS; ?>">
<link type="text/css" rel="stylesheet" href="<?php echo ABSWEBTPLPATH; ?>main.css">
</head>
<body>
<div class="superbar">
<div class="menuSearch">
<span>
<?php ShowSearchForm(); ?>
</span>
</div>
</div>
<div class="container">
<?php include(TPLPATH.'header.php'); ?>
<br/><br/><br/>
<div class="content">
<div class="contentLeft">
<div class="cLhead">
<h4>
Categories
</h4>
</div>
<ul class="categories">
<?php ShowMenu(); ?>
</ul>
</div>
<span class="contentRight">
<?php ListGoods(); ?>
</span>
</div>
<?php include(TPLPATH.'footer.php'); ?>
</div>
</body>
</html>
header.php 的 PHP
<div class="header-container">
<div class="wrapper">
</div>
<div id="header_top_right">
<div class="btn1">
<span class="menuPokupki"><div class="description"><a href="http://www.oplata.info" target="_blank">Мои покупки</a></div><div class="descriptionSub"><nobr>история покупок</nobr></div></span>
</div>
<div class="btn2">
<span>
<a href="<?php echo ABSWEBPATH; ?>" title="Мой магазин"><h5 >Мой магазин</h5></a>
</span>
</div>
<form action="<?php echo ABSWEBPATH; ?>ch_rt.php" method="post">
<span class="cnt">
Валюта:
<select name="rt" class="sorting">
<?php
session_start();
if(isset($_SESSION["rt"]) && !empty($_SESSION["rt"])) {
if($_SESSION["rt"] == "wmr" or $_SESSION["rt"] != "wmz" or $_SESSION["rt"] != "wme" or $_SESSION["rt"] != "wmu") {
echo "<option value=\"wmr\" selected=\"selected\">руб. (RUR)</option>\r\n"; }
else {echo "<option value=\"wmr\">руб. (RUR)</option>\r\n";}
if($_SESSION["rt"] == "wmz") {
echo "<option value=\"wmz\" selected=\"selected\">$ (USD)</option>\r\n"; }
else {echo "<option value=\"wmz\">$ (USD)</option>\r\n";}
if($_SESSION["rt"] == "wme") {
echo "<option value=\"wme\" selected=\"selected\">€ (EUR)</option>\r\n"; }
else {echo "<option value=\"wme\">€ (EUR)</option>\r\n";}
if($_SESSION["rt"] == "wmu") {
echo "<option value=\"wmu\" selected=\"selected\">грн. (UAH)</option>\r\n"; }
else {echo "<option value=\"wmu\">грн. (UAH)</option>\r\n";} }
else {
if(isset($default_rt) && !empty($default_rt)) {
if($default_rt == "wmr" or $default_rt != "wmz" or $default_rt != "wme" or $default_rt != "wmu") {
echo "<option value=\"wmr\" selected=\"selected\">руб. (RUR)</option>\r\n"; }
else {echo "<option value=\"wmr\">руб. (RUR)</option>\r\n";}
if($default_rt == "wmz") {
echo "<option value=\"wmz\" selected=\"selected\">$ (USD)</option>\r\n"; }
else {echo "<option value=\"wmz\">$ (USD)</option>\r\n";}
if($default_rt == "wme") {
echo "<option value=\"wme\" selected=\"selected\">€ (EUR)</option>\r\n"; }
else {echo "<option value=\"wme\">€ (EUR)</option>\r\n";}
if($default_rt == "wmu") {
echo "<option value=\"wmu\" selected=\"selected\">грн. (UAH)</option>\r\n"; }
else {echo "<option value=\"wmu\">грн. (UAH)</option>\r\n";} }
else {
echo "<option value=\"wmr\" selected=\"selected\">руб. (RUR)</option>
<option value=\"wmz\">$ (USD)</option>
<option value=\"wme\">€ (EUR)</option>
<option value=\"wmu\">грн. (UAH)</option>\r\n"; } }
?>
</select>
<input type="submit" value="Установить" class="button" />
</form></span></div>
</div>
<div class="subheader">
<ul class="menu">
<li class="menu1" noWrap><a href="about.php">О магазине</a></li>
<li class="menu1" noWrap><a href="pay.php">Способы оплаты</a></li>
<li class="menu1" noWrap><a href="contact.php">Контакты</a></li>
<span class="filter">
<span class="sortingTitle">Сортировка:</span>
<span class="sortingSelect">
<?php GoodsSort(); ?>
</span>
</span>
</ul>
</div>
</div>
</div>
CSS 有 500 行,所以我把它上传到了 pastebin 很抱歉糟糕的废话代码。我必须紧急编辑别人的,我已经讨厌他了