Sesii
3 отговора
128 прегледа
Sesii
<?
session_start();
$_SESSION["registrirana"] = 2;
?>
Razrabotvam edin site i izpolzvam phptriad obache toj e sys stara versiq na php-to i rabotata sys sesiite e malko po-razlichna. Kato go kachih na server s versiq 4.3.6 i neshtata korenno se promeniha. Zapochna da mi dava greshki ot tipa na: Warning: session_start(): Cannot send session cookie - headers already sent by (output started at .............)
i Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at .........) Sled kato prochetoh, che tozi tip greshki moje da se poluchi ot intervali iztrih vsichko i reshih da probvam, za da vidq dali shte mi registrira sesiqta. Kogato nqmam html code nqmam problemi regisrira mi sesiqta i vsichko raboti idealno. Kak moga da si registriram sesiq taka, che da nqmam problem.
session_start();
$_SESSION["registrirana"] = 2;
?>
Razrabotvam edin site i izpolzvam phptriad obache toj e sys stara versiq na php-to i rabotata sys sesiite e malko po-razlichna. Kato go kachih na server s versiq 4.3.6 i neshtata korenno se promeniha. Zapochna da mi dava greshki ot tipa na: Warning: session_start(): Cannot send session cookie - headers already sent by (output started at .............)
i Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at .........) Sled kato prochetoh, che tozi tip greshki moje da se poluchi ot intervali iztrih vsichko i reshih da probvam, za da vidq dali shte mi registrira sesiqta. Kogato nqmam html code nqmam problemi regisrira mi sesiqta i vsichko raboti idealno. Kak moga da si registriram sesiq taka, che da nqmam problem.
Re: Sesii
Въпроса е преди session_start да нямаш нищо. След него можеш да сложиш каквото си искаш - хтмл, РНР, и т.н. Примерно:
<?
session_start();
echo "<table>\n<tr>\n\t<td>Сесия:</td>\n\t<td>";
$_SESSION["registrirana"] = 2;
echo "$_SESSION[registrirana]</td>\n</tr>\n</table>";
?>
<?
session_start();
echo "<table>\n<tr>\n\t<td>Сесия:</td>\n\t<td>";
$_SESSION["registrirana"] = 2;
echo "$_SESSION[registrirana]</td>\n</tr>\n</table>";
?>
Re: Sesii
Golqma byrkotiq stava s tazi promqna v php-to. Na vsqka stranica li trqbva da slagam session_start() ?
Re: Sesii
[линк]
When a visitor accesses your site, PHP will check automatically (if session.auto_start is set to 1) or on your request (explicitly through session_start() or implicitly through session_register()) whether a specific session id has been sent with the request. If this is the case, the prior saved environment is recreated.
-----------------------
гърбавия, ковчег ще го изправи
When a visitor accesses your site, PHP will check automatically (if session.auto_start is set to 1) or on your request (explicitly through session_start() or implicitly through session_register()) whether a specific session id has been sent with the request. If this is the case, the prior saved environment is recreated.
-----------------------
гърбавия, ковчег ще го изправи