Хочу сделать, чтобы пароль и логин записывался в кукисы, вписал туда setCookie("c_user_name", $user_name, time() + 2678400); setCookie("c_password", $user_pass, time() + 2678400); В переменную c_user_name всё норм записывает, а вот в c_password не хочет, в чём ошибка? Вот функция set_variable(); PHP: function set_variable($variable_name) { global $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS, $$variable_name; $$variable_name = ""; //GPC order :) if (isset($HTTP_GET_VARS[$variable_name])) $$variable_name = $HTTP_GET_VARS[$variable_name]; if (isset($HTTP_POST_VARS[$variable_name])) $$variable_name = $HTTP_POST_VARS[$variable_name]; if (substr($variable_name,0,2)=="c_" && isset($HTTP_COOKIE_VARS[$variable_name])) $$variable_name = $HTTP_COOKIE_VARS[$variable_name]; //i don't use string-arrays in forms, only in the admin-zone, but there it's just design &lang names //which is normally doesn't have ' or " etc if (is_string($$variable_name)) { $$variable_name = str_replace("\0","", $$variable_name); $$variable_name = str_replace("\t"," ", $$variable_name); if (get_magic_quotes_gpc()) $$variable_name = stripslashes($$variable_name); } } А вот код страницы PHP: <?php require_once("inc_common.php"); set_variable("session"); set_variable("c_user_name"); set_variable("user_name"); set_variable("c_password"); set_variable("password"); if(!$user_name) $user_name = $c_user_name; if(!$password) $password = $c_password; $design = $default_design; if ($session != "") { include($engine_path."users_get_list_love.php"); if (!$exists) { $error_text = "$w_no_user"; include($file_path."designes/".$design."/error_page.php"); exit; } include_once("inc_user_class.php"); include($engine_path."users_get_object.php"); $registered_user = $is_regist; include($engine_path."user_din_data_update_love.php"); if($user_name) setCookie("c_user_name", $user_name, time() + 2678400); if($password) setCookie("c_password", $password, time() + 2678400); include("design_love.php"); exit; } $TryToBeInvisible = false; if(strlen($user_name) > 0) { if(substr($user_name, 0, 1) == "*") { $user_name = substr($user_name, 1); $TryToBeInvisible = true; } } include("inc_user_class.php"); //end DD setCookie("c_ulang", $user_lang, time() + 2678400); include("inc_to_canon_nick.php"); #check for nickname; if ((strlen($user_name)<$nick_min_length) or (strlen($user_name)>$nick_max_length)) { $error_text ="$w_incorrect_nick<br><a href=\"index.php\">$w_try_again</a>"; include($file_path."designes/".$design."/error_page.php"); exit; } if (ereg("[^".$nick_available_chars."]", $user_name)) { $error_text ="$w_incorrect_nick<br><a href=\"index.php\">$w_try_again</a>"; include($file_path."designes/".$design."/error_page.php"); exit; } if (strtolower($user_name) == strtolower(strip_tags($w_rob_name))) { $error_text ="$w_incorrect_nick<br><a href=\"index.php\">$w_try_again</a>"; include($file_path."designes/".$design."/error_page.php"); exit; } $canon_view = to_canon_nick($user_name); $old_user_name = $user_name; include($engine_path.'users_get_list_love.php'); $user_name = $old_user_name; $session = ''; for($i = 0; $i < count($users); $i++) { $user_array = explode("\t", trim($users[$i]), USER_TOTALFIELDS); if (strcmp($user_array[USER_CANONNICK],$canon_view) == 0) { $session = $user_array[USER_SESSION]; break; } } if($session == '') $session = md5(uniqid(rand())); $registered_user = 0; $users = array(); $htmlnick = ""; include($ld_engine_path."voc_user_data.php"); if (!$registered_user) { echo "Такой пользователь не зарегистрирован"; exit; } //DD Levandovka fix :-) if($current_user->user_class == 0 and $TryToBeInvisible) $TryToBeInvisible = false; if($current_user->custom_class != 0) $user_custom_class = $current_user->custom_class; //DD updating userinfo $is_regist = $registered_user; $current_user->IP = $IP; $current_user->browser_hash = $browser_hash; $current_user->cookie_hash = $c_hash; $current_user->session = $session; if(isset($_SERVER["HTTP_USER_AGENT"])) $current_user->user_agent = htmlspecialchars($_SERVER["HTTP_USER_AGENT"]); else $current_user->user_agent = htmlspecialchars($HTTP_SERVER_VARS['HTTP_USER_AGENT']); include($ld_engine_path."user_info_update.php"); //updating the similar nicks table $similars = array(); $fp1 = fopen($data_path."similar_nicks.tmp", "ab+"); if (!$fp1) trigger_error("Could not open ".$data_path."similar_nicks.tmp"." for writing. Please, check permissions", E_USER_ERROR); if (!flock($fp1, LOCK_EX)) trigger_error("Could not LOCK ".$data_path."similar_nicks.tmp"." file. Do you use Win 95/98/Me?", E_USER_WARNING); fseek($fp1,0); $isNickFoundInSimilars = false; while ($data = fgets($fp1, 4096)) { $u_data = explode("\t",str_replace("\r","",str_replace("\n","",$data))); $tov = 0; for($i = 0; $i < count($current_user->photo_voted); $i++) { $tov += $current_user->photo_voted_mark[$i]; } if ($u_data[0] == $is_regist) { $u_data[2] = $current_user->password; $u_data[3] = $current_user->email; $u_data[4] = $current_user->IP; $u_data[5] = $current_user->browser_hash; $u_data[6] = $current_user->cookie_hash; $u_data[7] = $current_user->points; $u_data[8] = $current_user->online_time; $u_data[9] = $current_user->credits; $u_data[10] = $tov; $isNickFoundInSimilars = true; } $similars[] .= implode("\t",$u_data) . "\n"; } if($user_name) setCookie("c_user_name", $user_name, time() + 2678400); if($password) setCookie("c_password", $password, time() + 2678400); include($engine_path."voc_love.php"); include("design_love.php"); ?>