PDA

View Full Version : مشکل با session



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!");
}
?>

oxygenws
جمعه 18 دی 1383, 09:27 صبح
مسلما با جستجو زودتر به جواب می رسید....
http://www.barnamenevis.org/forum/viewtopic.php?t=16445&highlight=headers
http://www.barnamenevis.org/forum/viewtopic.php?t=8665&highlight=headers
http://www.barnamenevis.org/forum/viewtopic.php?t=4246&highlight=headers

موفق باشید، امید

naeeme
جمعه 18 دی 1383, 11:16 صبح
من همچنان مشکل دارم. Register_globals برابر On هست. در هگزاادیت، هیچ کاراکتر عجیب و غریبی قبل از session_start وجود نداره. از تابع $_SESSION هم استفاده کردم، اما باز هم خطای زیر رو میده!! من چی کار کنم؟؟؟؟!!!!


Warning: session_start(): Cannot send session cookie - headers already sent in D:\project\www\_debug_tmp.php on line 2

Warning: session_start(): Cannot send session cache limiter - headers already sent in D:\project\www\_debug_tmp.php on line 2
User field set to dodell.PHP Warning: session_start(): Cannot send session cookie - headers already sent in D:\project\www\_debug_tmp.php on line 2 PHP Warning: session_start(): Cannot send session cache limiter - headers already sent in D:\project\www\_debug_tmp.php on line 2

oxygenws
جمعه 18 دی 1383, 11:23 صبح
توجه شما رو به خط زیر جلب می کنم، لطف کنید دقیقا بخونید ببینید چی نوشته:


headers already sent in D:\project\www\_debug_tmp.php on line 2