Topic: Is there a limit to PHP function?

Hi,
  I got the problem

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started
xajax5/xajax_core/plugin_layer/support/xajaxUserFunction.inc.php:191) in

  Today I'm registering 24 functions using $xajax->registerFunction
  If I comment any two entries it doesn't show it.
 
   Any idea what I'm missing?

Best Regards,
Guilherme Filho

Re: Is there a limit to PHP function?

Something has already been sent to the browser...

Ed

If you ever stop learning you may as well dig a hole, crawl in and pull the top over yourself.

Re: Is there a limit to PHP function?

Hi Ed.
    I thought that some function is having a warning but if I comment any of the two registerFunction it works normally...
    I check more if I found it I let you know!
Regards,
Gui

Re: Is there a limit to PHP function?

Hi Gui,

That is strange... Keep me posted.

Post the code?
Ed

If you ever stop learning you may as well dig a hole, crawl in and pull the top over yourself.

Re: Is there a limit to PHP function?

Hey Ed,
   Sorry the long delay.
   These are the functions I had to register:

$xajax->registerFunction('carregaFormulario'); /**/
$xajax->registerFunction('mostraPaises'); /*  */
$xajax->registerFunction('mostraCidades'); /* ok */
$xajax->registerFunction('mostraEstados'); /* ok */
$xajax->registerFunction('mostraTipoRua'); /* ok */
$xajax->registerFunction('confereC'); /*ok*/
$xajax->registerFunction('confereI');/*ok*/
$xajax->registerFunction('cadastraEmpresa');/* ok */
$xajax->registerFunction('buscaEmpresa');/* ok */
$xajax->registerFunction('gravaDadosEmpresa');/* ok */
$xajax->registerFunction('buscaEnderecoOnline');/* ok  */
$xajax->registerFunction('buscaEndereco');/* ok */
$xajax->registerFunction('buscaCadastro');/*  */
$xajax->registerFunction('exibeDadosEmpresa');/*  */
$xajax->registerFunction('verificaDocumentoBD');/*  */
$xajax->registerFunction('criaPastaNFe');/*  */
$xajax->registerFunction('criaBancodeDados');/*  */
$xajax->registerFunction('criaArquivoLogin');/*  */
$xajax->registerFunction('autorizaUserBD');/*  */
$xajax->registerFunction('listaUserOnline');/*  */
$xajax->registerFunction('listaAcesso');/*  */
$xajax->registerFunction('listaPerformance');/*  */
$xajax->registerFunction('bloqueiaEmpresa');/*  */
$xajax->registerFunction('salvaArquivoErro');/*  */
$xajax->registerFunction('clienteDHCPD');/*  */

It shows:
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /var/www/html/Plotag/Sistema/Sistema/xajax5/xajax_core/plugin_layer/support/xajaxUserFunction.inc.php:190) in /var/www/html/Plotag/Sistema/Sistema/Uteis/Session.php on line 53

On line 53 has a session_start

On the head tag it shows:
/* <![CDATA[ */
xajax_carregaFormulario = function() { return xajax.request( { xjxfun: 'carregaFormulario' }, { parameters: arguments } ); };
xajax_mostraPaises = function() { return xajax.request( { xjxfun: 'mostraPaises' }, { parameters: arguments } ); };
xajax_mostraCidades = function() { return xajax.request( { xjxfun: 'mostraCidades' }, { parameters: arguments } ); };
xajax_mostraEstados = function() { return xajax.request( { xjxfun: 'mostraEstados' }, { parameters: arguments } ); };
xajax_mostraTipoRua = function() { return xajax.request( { xjxfun: 'mostraTipoRua' }, { parameters: arguments } ); };
xajax_confereC = function() { return xajax.request( { xjxfun: 'confereC' }, { parameters: arguments } ); };
xajax_confereI = function() { return xajax.request( { xjxfun: 'confereI' }, { parameters: arguments } ); };
xajax_cadastraEmpresa = function() { return xajax.request( { xjxfun: 'cadastraEmpresa' }, { parameters: arguments } ); };
xajax_buscaEmpresa = function() { return xajax.request( { xjxfun: 'buscaEmpresa' }, { parameters: arguments } ); };
xajax_gravaDadosEmpresa = function() { return xajax.request( { xjxfun: 'gravaDadosEmpresa' }, { parameters: arguments } ); };
xajax_buscaEnderecoOnline = function() { return xajax.request( { xjxfun: 'buscaEnderecoOnline' }, { parameters: arguments } ); };
xajax_buscaEndereco = function() { return xajax.request( { xjxfun: 'buscaEndereco' }, { parameters: arguments } ); };
xajax_buscaCadastro = function() { return xajax.request( { xjxfun: 'buscaCadastro' }, { parameters: arguments } ); };
xajax_exibeDadosEmpresa = function() { return xajax.request( { xjxfun: 'exibeDadosEmpresa' }, { parameters: arguments } ); };
xajax_verificaDocumentoBD = function() { return xajax.request( { xjxfun: 'verificaDocumentoBD' }, { parameters: arguments } ); };
xajax_criaPastaNFe = function() { return xajax.request( { xjxfun: 'criaPastaNFe' }, { parameters: arguments } ); };
xajax_criaBancodeDados = function() { return xajax.request( { xjxfun: 'criaBancodeDados' }, { parameters: arguments } ); };
xajax_criaArquivoLogin = function() { return xajax.request( { xjxfun: 'criaArquivoLogin' }, { parameters: arguments } ); };
xajax_autorizaUserBD = function() { return xajax.request( { xjxfun: 'autorizaUserBD' }, { parameters: arguments } ); };
xajax_listaUserOnline = function() { return xajax.request( { xjxfun: 'listaUserOnline' }, { parameters: arguments } ); };
xajax_listaAcesso = function() { return xajax.request( { xjxfun: 'listaAcesso' }, { parameters: arguments } ); };
xajax_listaPerformance = function() { return xajax.request( { xjxfun: 'listaPerformance' }, { parameters: arguments } ); };
xajax_bloqueiaEmpresa = function() { return xajax.request( { xjxfun: 'bloqueiaEmpresa' }, { parameters: arguments } ); };
xajax_salvaArquivoErro = function() { return xajax.request( { xjxfun: 'salvaArquivoErro' }, { parameters: arguments } ); };
xajax_clienteDHCPD = function() { return xajax.request( { xjxfun: 'clienteDHCPD' }, { parameters: arguments } ); };
/* ]]> */

Nothing weird..
     
If I comment any 3  registerFunction it works without warning.

Some idea?

Re: Is there a limit to PHP function?

Try putting the session_start as close as possible to the beginning of the file.

I have it in the 3rd line of my common code include file.

If you ever stop learning you may as well dig a hole, crawl in and pull the top over yourself.

Re: Is there a limit to PHP function?

I'm checking my code and I got this:
I do
     echo '<!DOCTYPE html>
         <html>
            <head>
               <meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" />
               <meta http-equiv="Content-Language" content="pt-br" />
               <meta http-equiv="Cache-Control" content="no-cache, no-store" />
               <meta http-equiv="Pragma" content="no-cache, no-store" />';
      $xajax->printJavascript("../../../Sistema/xajax/");
      if ( session_status()==PHP_SESSION_NONE ) {session_segura();if( !isset($_SESSION['userid'])) termina_sessao();}

This last line I check if the session is started and corrected (I check IP and user browser) if it's not I call termina_sessao to close the windows.
If I check before printJavascript the Warning doesn't happen, if I check after it  happens.
I always checked after I guess because this file register too many functions it sends before finishing?

Re: Is there a limit to PHP function?

Try putting your session check further up in the source code.

If you ever stop learning you may as well dig a hole, crawl in and pull the top over yourself.

Re: Is there a limit to PHP function?

Yes, I did, it works....
Maybe the quantity of data makes the server send it before the session checking.
Anyway it worked checking before.
Thank you one more time!