Jams Medalla Jams Medalla - 5 months ago 8
PHP Question

My css doesn't work after the php codes

My css doesn't work after the php codes. I'd have to rewrite the whole html code after the elseif's for the format to work. I've tried inserting the html codes in 's but it still won't style the way it should. my navigation won't show either. i don't understand.

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";
}

Answer

Try this:

 <!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>
<?php
if(isset($_POST['sby'])){
  $value = $_POST['sby'];
  if(isset($_POST['search'])){
      if($value == 'cname'){?>

This way, the top of you page will show up, regardless of the value of $value.

Comments