1

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";
}
4
  • 1
    php server side, css\html client side, anyway i have no idea what you are asking. looks like some of the html, the header block, should be outside the php loop ... move the first php block to below <body> Commented Oct 26, 2012 at 4:02
  • That's because the php code needs to go after you call the CSS, otherwise it will only load when $value=cname. Commented Oct 26, 2012 at 4:04
  • The tables after the elseif's would show but the formatting won't follow. my navigation is gone, the logo is gone. just a plain table without styling. I'm sorry if it's confusing. Commented Oct 26, 2012 at 4:06
  • I've tried calling the css after the elseif's but my navigation is gone. what i'd want to happen is for the page to still hav the navigation, logo, footer, and styling. am i hard to understand? i'm really sorry Commented Oct 26, 2012 at 4:08

3 Answers 3

2

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.

Sign up to request clarification or add additional context in comments.

Comments

0

I had a similar problem. If it's under any other Category like <a href> then don't put the style to be normal id but you must put it as it's with the Category #something a:hover hope that helps.

Comments

-1

try editing this part:

href="../../css/style.css"

and change it to

href="css/style.css"

or you can try doing it manually

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.