Jump to content
php.lv forumi

Recommended Posts

Posted

Kaa uztaisiit taa ka saglabaa vairaak Varus vienaa cookie?

Probleema taada:

setcookie ("user", $user);

setcookie ("theme", $theme);

ja shaadi rakstu vinsh izmet error:

 

Warning: Cannot add header information - headers already sent by (output started at ....

 

Warning: Cannot add header information - headers already sent by (output started at ....

 

Kaa to apiet?

 

Kaut kaa shaadi?

setcookie ("cookie[three]", "cookiethree");

setcookie ("cookie[two]", "cookietwo");

setcookie ("cookie[one]", "cookieone");

Posted (edited)

Varbūt tādēļ, ka vispirms vajag ieslēgt output buffering, lai nekādi headeri netiktu sūtīti pirms laika?

ob_start();
setcookie ("user", $user);
setcookie ("theme", $theme);
ob_end_flush();

Edited by Aleksejs
Posted
Kaa uztaisiit taa ka saglabaa vairaak Varus vienaa cookie?

Probleema taada:

setcookie ("user", $user);

setcookie ("theme", $theme);

ja shaadi rakstu vinsh izmet error:

 

Warning: Cannot add header information - headers already sent by (output started at ....

 

Warning: Cannot add header information - headers already sent by (output started at ....

 

Kaa to apiet?

 

Kaut kaa shaadi?

setcookie ("cookie[three]", "cookiethree");

setcookie ("cookie[two]", "cookietwo");

setcookie ("cookie[one]", "cookieone");

cookie ir jaauzstaada pirms tu suuti jebkaadu saturu uz paarluukprogrammu. Taa arii ir visa kljuuda ;) .. sookie peec kaartas tu vari uzstaadiit kaut vai 10, vienkaarshi pirms tam tev nedriikst buut nekaads html, ne taisiits ar echo, ne arii vienkaarshss inline html ..

×
×
  • Create New...