Hi

I have a very strange issue with a page layout.
I have created numerous pages based on a template layout that I created in CSS through Dreamweaver.
All the pages look as they should in Chrome/Safari etc.
All the pages EXCEPT 1 looks fine in IE.

Please take a look:
Click Here

Chrome/Safari.... fine
IE - off to the left and the dropdowns don't work.

I've recreated the page from scratch but I'm just very confused about why this should happen.

OK So I tried the 'link' button there.
The URL is:

www.dev.bright-tutors.com/login.php

The page does not like the lump of PHP code being at the top of the page. If I move the code to just above the <FORM> in the body - then the layout stays good.
However I'm then stopped by error messages regarding headers not being able to be sent.

<?php // Clear the error message
  $error_msg = "";

  // If the user isn't logged in, try to log them in
  if (!isset($_SESSION['ID'])) {
    if (isset($_POST['submit'])) {

      // Connect to the database
      require_once ('dbc.php');

      // Grab the user-entered log-in data
      $user_username = mysqli_real_escape_string($dbc, trim($_POST['username']));
      $user_password = mysqli_real_escape_string($dbc, trim($_POST['password']));

      if (!empty($user_username) && !empty($user_password)) {
        // Look up the username and password in the database
        $query = "SELECT ID, username FROM dev_tutor_reg WHERE status = 'activated' AND username = '$user_username' AND password = sha1('$user_password')";
        $data = mysqli_query($dbc, $query);

        if (mysqli_num_rows($data) == 1) {
          // The log-in is OK so set the user ID and username session vars (and cookies), and redirect to the home page
          $row = mysqli_fetch_array($data);
          $_SESSION['ID'] = $row['ID'];
          $_SESSION['username'] = $row['username'];
          $_SESSION['sessiontype'] = "tutor";
          setcookie('ID', $row['ID'], time() + (60 * 60 * 24 * 1));    // expires in 1 days
          setcookie('username', $row['username'], time() + (60 * 60 * 24 * 1));  // expires in 1 days
          setcookie('sessiontype', "tutor", time() + (60 * 60 * 24 * 1));  // expires in 1 days
          $home_url = 'http://' . $_SERVER['HTTP_HOST'] . '/myAccount.php';
          header('Location: ' . $home_url);
        }
  else {
          // The username/password are incorrect so set an error message
    $error_msg = 'Sorry, either your account has not been activated or you have incorrectly entered your username or password. Please follow the link sent to a valid email address when you registered.' ; 
        }
      }

      else {
        // The username/password weren't entered so set an error message
   $error_msg = 'Please enter a valid username and password.'; 
   }
  } 
}

I then get the following error message:
Warning: Cannot modify header information - headers already sent by (output started at /home/brighttu/public_html/dev/login - Copy.php:175) in /home/brighttu/public_html/dev/login - Copy.php on line 272

When the code is at the top of the page - this seems to be fine.

I'm not sure how to separate my queries so that the part that is required up front is at the top.

Any help would be great.

Member Avatar

Warning: Cannot modify header information - headers already sent by (output started at /home/brighttu/public_html/dev/login - Copy.php:175) in /home/brighttu/public_html/dev/login - Copy.php on line 272

Remove this line:

header('Location: ' . $home_url);

Then run the code again.

Regarding about CSS.

Do you have code that is CSS3?

If so then most likely you have to check whether certain browser can supported it.

There might be problem in css of div id="mainbody".Look into that.

Hi. Thanks for getting back to me.
Yes I've tried just removing that line and the result is the same.
Yes it is CSS3.
The strange things is that it is only this page - and all the pages run off the same template. So it must be to do with not liking some part of the PHP script in the head.

Member Avatar

The page layout won't be down to php. Whether an include file is included or not will be down to php.
Look at the underlying html output in your browser's 'Source View' or whatever it's called in your version. Does it look right?
Using Chrome's 'Inspect Element', you can check resolved CSS rules etc.