trananhchien Posted April 25, 2008 Posted April 25, 2008 My web have one error when I enter my web, I see error - on the top of web page is: Warning: extract() [function.extract]: First argument should be an array in /home2/shophcom/public_html/includes/application_top.php on line 220 - On the bottom of web page is: Warning: Invalid argument supplied for foreach() in /home2/shophcom/public_html/includes/functions/sessions.php on line 110 But I refresh or reload, this error is not appear. Can you help me? http://shopnhanh.com
arietis Posted April 25, 2008 Posted April 25, 2008 - on the top of web page is: Warning: extract() [function.extract]: First argument should be an array in /home2/shophcom/public_html/includes/application_top.php on line 220 please post the contents of your includes/application_top.php file and i can try to help you.
trananhchien Posted April 25, 2008 Author Posted April 25, 2008 Please indicate lines that give error. on the top of web page is: Warning: extract() [function.extract]: First argument should be an array in /home2/shophcom/public_html/includes/application_top.php on line 220 - On the bottom of web page is: Warning: Invalid argument supplied for foreach() in /home2/shophcom/public_html/includes/functions/sessions.php on line 110
Guest Posted April 25, 2008 Posted April 25, 2008 on the top of web page is: Warning: extract() [function.extract]: First argument should be an array in /home2/shophcom/public_html/includes/application_top.php on line 220 - On the bottom of web page is: Warning: Invalid argument supplied for foreach() in /home2/shophcom/public_html/includes/functions/sessions.php on line 110 Do you expect that I will count the lines in the files you posted?
markg-uk Posted April 25, 2008 Posted April 25, 2008 Did it ever work? Did it work before you installed the template?
trananhchien Posted April 25, 2008 Author Posted April 25, 2008 Do you expect that I will count the lines in the files you posted? Line 220 -240 // AGM Register Globals MOD if (!ini_get("register_globals")) { if (version_compare(phpversion(), "4.1.0", "<") === true) { if (isset($HTTP_SESSION_VARS)) $_SESSION &= $HTTP_SESSION_VARS; } extract($_SESSION, EXTR_SKIP); } // set SID once, even if empty $SID = (defined('SID') ? SID : ''); // verify the ssl_session_id if the feature is enabled if ( ($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == true) && ($session_started == true) ) { $ssl_session_id = getenv('SSL_SESSION_ID'); if (!tep_session_is_registered('SSL_SESSION_ID')) { $SESSION_SSL_ID = $ssl_session_id; tep_session_register('SESSION_SSL_ID'); } if ($SESSION_SSL_ID != $ssl_session_id) { tep_session_destroy(); tep_redirect(tep_href_link(FILENAME_SSL_CHECK)); } } session.php line 110 - 143 // AGM Register Globals MOD function tep_session_close() { foreach($_SESSION as $key => $value) { global $$key; $_SESSION[$key] = $$key; } } function tep_session_destroy() { return session_destroy(); } function tep_session_save_path($path = '') { if (!empty($path)) { return session_save_path($path); } else { return session_save_path(); } } function tep_session_recreate() { if (PHP_VERSION >= 4.1) { $session_backup = $_SESSION; unset($_COOKIE[tep_session_name()]); tep_session_destroy(); if (STORE_SESSIONS == 'mysql') { session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc'); } tep_session_start(); $_SESSION = $session_backup; unset($session_backup); }
Guest Posted April 25, 2008 Posted April 25, 2008 Line 220 -240 // AGM Register Globals MOD if (!ini_get("register_globals")) { if (version_compare(phpversion(), "4.1.0", "<") === true) { if (isset($HTTP_SESSION_VARS)) $_SESSION &= $HTTP_SESSION_VARS; } extract($_SESSION, EXTR_SKIP); } // set SID once, even if empty $SID = (defined('SID') ? SID : ''); // verify the ssl_session_id if the feature is enabled if ( ($request_type == 'SSL') && (SESSION_CHECK_SSL_SESSION_ID == 'True') && (ENABLE_SSL == true) && ($session_started == true) ) { $ssl_session_id = getenv('SSL_SESSION_ID'); if (!tep_session_is_registered('SSL_SESSION_ID')) { $SESSION_SSL_ID = $ssl_session_id; tep_session_register('SESSION_SSL_ID'); } if ($SESSION_SSL_ID != $ssl_session_id) { tep_session_destroy(); tep_redirect(tep_href_link(FILENAME_SSL_CHECK)); } } session.php line 110 - 143 // AGM Register Globals MOD function tep_session_close() { foreach($_SESSION as $key => $value) { global $$key; $_SESSION[$key] = $$key; } } function tep_session_destroy() { return session_destroy(); } function tep_session_save_path($path = '') { if (!empty($path)) { return session_save_path($path); } else { return session_save_path(); } } function tep_session_recreate() { if (PHP_VERSION >= 4.1) { $session_backup = $_SESSION; unset($_COOKIE[tep_session_name()]); tep_session_destroy(); if (STORE_SESSIONS == 'mysql') { session_set_save_handler('_sess_open', '_sess_close', '_sess_read', '_sess_write', '_sess_destroy', '_sess_gc'); } tep_session_start(); $_SESSION = $session_backup; unset($session_backup); } From what you posted, the commented lines are the cause of the problem in your installation of Register Globals Easy addon. That does seem strange. The said function and arguement cannot be seen. Maybe recheck your edits and ensure that the edits were done in the correct locations in the correct files. There were edits for catalog and admin.
arietis Posted April 25, 2008 Posted April 25, 2008 in application_top, starting on line 215 you have: // AGM Register Globals MOD if (!ini_get("register_globals")) { if (version_compare(phpversion(), "4.1.0", "<") === true) { if (isset($HTTP_SESSION_VARS)) $_SESSION &= $HTTP_SESSION_VARS; } extract($_SESSION, EXTR_SKIP); /// <-- line 220 with the error } the extract() function wants an array, and for some reason $_SESSION isn't one. this is strange. seeing the comment, "AGM Register Globals MOD"...it's obvious that changes have been made. has the code worked before, but stopped working recently? what changes have you made recently? maybe the new changes are causing the problem. the first reference in the file of the $HTTP_SESSION_VARS variable is in this block...so maybe it hasn't been initialized? in the current code release, the compatibility.php file should do all of this for you, but your code is dated july 2003 so i'm not sure what that file is doing. did your host recently upgrade your version of php? this would cause the $_SESSION &= $HTTP_SESSION_VARS on line 218 to not be executed...but even without this, the $_SESSION variable should exist -- it's a global. there's something else going on. maybe take a look in compatibility.php and see what it's doing with the global arrays. that might tell you something.
trananhchien Posted April 28, 2008 Author Posted April 28, 2008 in application_top, starting on line 215 you have: // AGM Register Globals MOD if (!ini_get("register_globals")) { if (version_compare(phpversion(), "4.1.0", "<") === true) { if (isset($HTTP_SESSION_VARS)) $_SESSION &= $HTTP_SESSION_VARS; } extract($_SESSION, EXTR_SKIP); /// <-- line 220 with the error } the extract() function wants an array, and for some reason $_SESSION isn't one. this is strange. seeing the comment, "AGM Register Globals MOD"...it's obvious that changes have been made. has the code worked before, but stopped working recently? what changes have you made recently? maybe the new changes are causing the problem. the first reference in the file of the $HTTP_SESSION_VARS variable is in this block...so maybe it hasn't been initialized? in the current code release, the compatibility.php file should do all of this for you, but your code is dated july 2003 so i'm not sure what that file is doing. did your host recently upgrade your version of php? this would cause the $_SESSION &= $HTTP_SESSION_VARS on line 218 to not be executed...but even without this, the $_SESSION variable should exist -- it's a global. there's something else going on. maybe take a look in compatibility.php and see what it's doing with the global arrays. that might tell you something. Who can you guide me to repare it
arietis Posted April 29, 2008 Posted April 29, 2008 Who can you guide me to repare it please answer the questions in my previous post and i, or someone else, may be able to help you. if you don't understand the questions, just let us know and we'll guide you through it - but we really need the answers in order to help.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.