我的css在php代码之后不起作用。我必须在 elseif 之后重写整个 html 代码才能使格式正常工作。我已经尝试在 's 中插入 html 代码,但它仍然不会按应有的方式设置样式。我的导航也不会显示。我不明白。
if(isset($_POST['sby'])){
$value = $_POST['sby'];
if(isset($_POST['search'])){
if($value == 'cname'){?>
<!doctype html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<link href="../../css/style.css" rel="stylesheet" type="text/css" />
<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
</head>
<body>
<div class="container">
<header>
<a href="home.php"><img src="../../img/Intellibest-EMM Logo.jpg" alt="Insert Logo Here" name="Insert_logo" width="180" height="141" id="Insert_logo" style="background-color: #C6D580; display:block;" /></a>
</header>
<div class="sidebar1" style="height:auto">
<ul class="nav">
<li><a href="../home.php">Home</a></li>
<li><a href="../look.php">Look For</a></</li>
<li><a href="../make.php">Make Something</a></li>
<li><a href="../settings.php">Settings</a></li>
</ul>
</div>
<table>
<thead id="tbl">
<tr>
<td><h3>Company Name</h3></td>
</tr>
</thead>
<?php do { ?>
<tbody id="result">
<tr>
<td>
<?php echo $row_get_cname['Company Name'];?>
</td>
<?php } while ($row_get_cname = mysql_fetch_assoc($get_cname)); ?>
</tr>
</table>
<?php }
else if($value == 'ename'){?>
<table>
<thead id="tbl">
<tr>
<td><h3>First Name</h3></td>
<td><h3>Last Name</h3></td>
<td><h3>Position</h3></td>
<td><h3>Company Name</h3></td>
</tr>
</thead>
<?php do { ?>
<tbody id="result">
<tr>
<td>
<?php echo $row_get_ename['First Name'].' '.$row_get_ename['Last Name'].'<br>'.$row_get_ename['Position'].'<br>'.$row_get_ename['client companies (pana)`.`Company Name'];?>
</td>
<?php } while ($row_get_ename = mysql_fetch_assoc($get_ename)); ?>
</tr>
</tbody>
</table>
<?php }
else if($value == 'iname'){
echo "<table>
<thead id=tbl>
<tr>
<td><h3>Company Name</h3></td>
<td><h3>Industry</h3></td>
</tr>
</thead>";
do {
echo "<tbody id=result>
<tr>
<td>";
echo $row_get_iname['Company Name'].'</td><td>'.$row_get_iname['Industry'];
echo "</td>";
} while ($row_get_iname = mysql_fetch_assoc($get_iname));
echo "</tr>
</tbody>
</table>";
}
else{
echo "Please enter a valid search quer";
}
}
else{
echo "Please define search";
}
}
else{
echo "Please enter a search query";
}