0

I have this view with codeigniter:

<!DOCTYPE html>
<html>
<head>  
<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/bootstrap/css2/bootstrap.css"/>
<title>example</title>
</head> 
<body>
<p>Hello</p>
</body>
</html>

And this controller:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Merc_inicio extends CI_Controller {

    function index()
    {
        $this->load->view('plantilla');
    }
}   

?>

So in IE8 and Firefox the renderization is:

<html>
<head>
</head>
<body>
    <link href="http://10.66.130.131/mercurio_p/assets/bootstrap/css2/bootstrap.css" type="text/css" rel="stylesheet"></link>
<title>
      example
</title>
<p>Hello</p>
</body>
</html>

Why head tags is beig renderized inside body tags? I don't know what is happening. Do you?

xgrager
  • 3
  • 4

2 Answers2

0

Try this

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Merc_inicio extends CI_Controller {

function __construct(){
    parent::__construct();
    $this->load->helper('url');
    }
function index()
{
    $this->load->view('plantilla');
}
}   

?>
0

You must save files as utf-8 without BOM

Denis
  • 16
  • Welcome to Stack Overflow! Can you elaborate a little more on why you think this will solve xgrager's problem? This is very minimal information, and I have to admit that I don't how this will help. – Derek Oct 07 '13 at 21:08
  • Awesome! this fix my issue. Thanks a lot. Here some explanations about the difference between utf with and without bom: http://stackoverflow.com/questions/2223882/whats-different-between-utf-8-and-utf-8-without-bom – xgrager Oct 08 '13 at 06:44