naeeme
پنج شنبه 17 دی 1383, 22:01 عصر
وقتی از session استفاده می کنم این پیغام رو میده:
Warning: session_start(): Cannot send session cookie - headers already sent in D:\Saher\source code\Ch08\_debug_tmp.php on line 3
Warning: session_start(): Cannot send session cache limiter - headers already sent in D:\Saher\source code\Ch08\_debug_tmp.php on line 3
User field set to dodell.PHP Warning: session_start(): Cannot send session cookie - headers already sent in D:\Saher\source code\Ch08\_debug_tmp.php on line 3 PHP Warning: session_start(): Cannot send session cache limiter - headers already sent in D:\Saher\source code\Ch08\_debug_tmp.php on line 3
کجا رو باید تنظیم کنم و چه جوری؟ در ضمن من تو php.ini، تغییراتی دادم. session.save_path رو برابر جایی که می خواستم ذخیره بشن قرار دادم.
من از کدهای زیر استفاده می کنم که از یک کتاب یرداشتم:
<?php
session_start(); // start or continue the session
$user = "dodell"; // initialize a variable for the user
// register the "user" variable and give output.
if (session_register("user")) {
echo("User field set to $user.");
} else {
echo("Could not set the session variable!");
}
?>
Warning: session_start(): Cannot send session cookie - headers already sent in D:\Saher\source code\Ch08\_debug_tmp.php on line 3
Warning: session_start(): Cannot send session cache limiter - headers already sent in D:\Saher\source code\Ch08\_debug_tmp.php on line 3
User field set to dodell.PHP Warning: session_start(): Cannot send session cookie - headers already sent in D:\Saher\source code\Ch08\_debug_tmp.php on line 3 PHP Warning: session_start(): Cannot send session cache limiter - headers already sent in D:\Saher\source code\Ch08\_debug_tmp.php on line 3
کجا رو باید تنظیم کنم و چه جوری؟ در ضمن من تو php.ini، تغییراتی دادم. session.save_path رو برابر جایی که می خواستم ذخیره بشن قرار دادم.
من از کدهای زیر استفاده می کنم که از یک کتاب یرداشتم:
<?php
session_start(); // start or continue the session
$user = "dodell"; // initialize a variable for the user
// register the "user" variable and give output.
if (session_register("user")) {
echo("User field set to $user.");
} else {
echo("Could not set the session variable!");
}
?>