2
My application is a website for a real estate company and I’m having problems with a feature developed with Session similar to a shopping cart to add more than one property in a single proposal. The problem that this happening, is that when selected a property is created the session however, there are times that the property appears in the order list and there are times that no, and there are times that only appears after a certain time(delay).
Can this issue be related to ob_start() and end_flush()? Can anyone give me any hints as to what might be going on?
My application this way:
<?php
ob_start();
session_start();
require('includes/paginator.class.php');
require('includes/cookie.class.php');
require('config/get.php');
require('config/config.php');
require_once ('includes/recaptchalib.php');
require_once('classes/Conexao.php');
require_once('classes/Carrinho.php');
<conteúdo estatico head>
<conteúdo estatico header>
<conteúdo dinamico com includes das páginas(contato/institucional/pedido/etc)>
<conteúdo estático footer>
end_flush();
?>
When you use
ob_start();
andend_flush();
you are saying that the HTML content will be printed between these two elements, you should not put the class requires, connection, and config etc. within these rules, nor thesession_start();
.– Ivan Ferrer
If I understand correctly, all ob_start(); and session_start(); should it be after includes and require? Usually people say they should stay ahead of everything.
– Igor Silva