MTG Mania Posted July 29, 2012 Share Posted July 29, 2012 Hiya. I downloaded and installed the USPS Methods 6.1a module, along with the required xml files, and lo and behold (I knew this wasn't going to be "easy" lol) I get this error in my admin panel when I go to download and re-install the module (per the instructions that came with the add on) Deprecated: Assigning the return value of new by reference is deprecated in /home/xxxxxxx/xxxxxx_xxxx/admin/includes/classes/xml_5.php on line 25. I followed the instructions step by step, and VERY slowly, triple checking the whole way making sure I was putting what goes where in the correct spots. Any ideas on this error and why I am getting it? Any advice on fixing it? Here is the string of coding: //################################################################################## // XML_unserialize: takes raw XML as a parameter (a string) // and returns an equivalent PHP data structure //################################################################################## function & XML_unserialize(&$xml){ $xml_parser = &new XML(); <--------------------------- LINE 25 $data = &$xml_parser->parse($xml); $xml_parser->destruct(); return $data; } //################################################################################## // XML_serialize: serializes any PHP data structure into XML // Takes one parameter: the data to serialize. Must be an array. //################################################################################## function & XML_serialize(&$data, $level = 0, $prior_key = NULL){ if($level == 0){ ob_start(); echo '<?xml version="1.0" ?>',"\n"; } while(list($key, $value) = each($data)) Quote Link to comment Share on other sites More sharing options...
germ Posted July 29, 2012 Share Posted July 29, 2012 I'm not entirely sure this will work, but try this: $xml_parser = new XML(); Quote If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
♥kymation Posted July 29, 2012 Share Posted July 29, 2012 You'll have to fix Line 26 as well: $data = $xml_parser->parse($xml); Regards Jim Quote See my profile for a list of my addons and ways to get support. Link to comment Share on other sites More sharing options...
MTG Mania Posted July 29, 2012 Author Share Posted July 29, 2012 (edited) @@germ Thank you!!! That worked. Buuuuuut.... NOW... I installed, set the settings for everything, click save and WHAMMO!!! This is my greeting! Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39 Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39 Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39 Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39 Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39 Deprecated: Function ereg_replace() is deprecated in /home/admin/modules.php on line 39 Deprecated: Function ereg_replace() is deprecated in /home/admin/modules.php on line 39 Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39 Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39 Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39 Deprecated: Function ereg_replace() is deprecated in /homel/admin/modules.php on line 39 Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39 Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39 Deprecated: Function ereg_replace() is deprecated in /home//admin/modules.php on line 39 Warning: Cannot modify header information - headers already sent by (output started at //admin/modules.php:39) in /home/admin/includes/functions/general.php on line 34 Allllllll over my admin panel. Here is the code: if (tep_not_null($action)) { switch ($action) { case 'save': reset($HTTP_POST_VARS['configuration']); while (list($key, $value) = each($HTTP_POST_VARS['configuration'])) { if( is_array( $value ) ){ $value = implode( ", ", $value); $value = ereg_replace (", --none--", "", $value); } tep_db_query("update " . TABLE_CONFIGURATION . " set configuration_value = '" . $value . "' where configuration_key = '" . $key . "'"); } tep_redirect(tep_href_link(FILENAME_MODULES, 'set=' . $set . '&module=' . $HTTP_GET_VARS['module'])); break; case 'install': case 'remove': And here is funtions: if ( (strstr($url, "\n") != false) || (strstr($url, "\r") != false) ) { tep_redirect(tep_href_link(FILENAME_DEFAULT, '', 'NONSSL', false)); } header('Location: ' . $url); <--------------------- Line 34 if (STORE_PAGE_PARSE_TIME == 'true') { if (!is_object($logger)) $logger = new logger; $logger->timer_stop(); } exit; } A little help with this too, please? :sweating: :blush: Edited July 29, 2012 by MTG Mania Quote Link to comment Share on other sites More sharing options...
germ Posted July 29, 2012 Share Posted July 29, 2012 Try: $value = preg_replace ('/, --none--/', '', $value); Quote If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
MTG Mania Posted July 29, 2012 Author Share Posted July 29, 2012 @@germ LMAO Well, that fixed the admin panel throwing up all over itself, but the original error is back now. :lol: :'( Quote Link to comment Share on other sites More sharing options...
germ Posted July 29, 2012 Share Posted July 29, 2012 Did you catch the post by the other JIm? :unsure: Quote If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
MTG Mania Posted July 29, 2012 Author Share Posted July 29, 2012 @@germ Yup. Took out the & on that line too :-/ Quote Link to comment Share on other sites More sharing options...
MTG Mania Posted July 29, 2012 Author Share Posted July 29, 2012 ROFL but the module works.... sort of! LMAO except for that string of "error" code showing on the top of my checkout/shipping page Quote Link to comment Share on other sites More sharing options...
germ Posted July 29, 2012 Share Posted July 29, 2012 You'll have to post the error message. I'm not "magic" like you. :blush: Quote If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
MTG Mania Posted July 29, 2012 Author Share Posted July 29, 2012 @@germ It's the same original one..... Deprecated: Assigning the return value of new by reference is deprecated in /includes/classes/xml_5.php on line 25 Quote Link to comment Share on other sites More sharing options...
MTG Mania Posted July 29, 2012 Author Share Posted July 29, 2012 Shit. Wait a minute. Reading is my friend. It's the OTHER XML file now giving me shit. One second, let me make sure it's not the same coding error there too. Quote Link to comment Share on other sites More sharing options...
germ Posted July 29, 2012 Share Posted July 29, 2012 @@germ LMAO Well, that fixed the admin panel throwing up all over itself, but the original error is back now. :lol: :'( I like the visual.... (w00t) So what';s the code from the file on line 25? :unsure: Quote If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
MTG Mania Posted July 29, 2012 Author Share Posted July 29, 2012 Holy crap, it's a MIRACLE. I fixed it. Thanks, you guys!! You are awesome for helping this php MORON, who obviously needs to READ things a little better!!! Quote Link to comment Share on other sites More sharing options...
MTG Mania Posted July 29, 2012 Author Share Posted July 29, 2012 @@germ I fixed it (I think, hope pray lol) Thank you so much for helping me!! You, and the others like you have NO idea how much I appreciate it!! Without you guys helping me along the way, I never would have figured HALF of this stuff out!!! Quote Link to comment Share on other sites More sharing options...
Juto Posted July 29, 2012 Share Posted July 29, 2012 Hi Magic, congrats... :) So please update the addon then. Sara Quote Contributions: http://addons.oscommerce.com/info/8010 http://addons.oscommerce.com/info/8204 http://addons.oscommerce.com/info/8681 Link to comment Share on other sites More sharing options...
MTG Mania Posted July 29, 2012 Author Share Posted July 29, 2012 Hi Magic, congrats... :) So please update the addon then. Sara Do I just download my "fixed" php's and upload it as a "fix" on the add on page that I downloaded it from, or? I have not updated any add on's before. And thanks!! lol Without the 2 Jim's I would have been in a real fix, so the credit is really due to them!! Cindy Quote Link to comment Share on other sites More sharing options...
Juto Posted July 29, 2012 Share Posted July 29, 2012 Hi Cindy, best is to upload a new package with comments on what's fixed, how and where. So, zip your version and upload with a new number. Sara Coding is a looooooooot of coffe... and snacks... :) Quote Contributions: http://addons.oscommerce.com/info/8010 http://addons.oscommerce.com/info/8204 http://addons.oscommerce.com/info/8681 Link to comment Share on other sites More sharing options...
♥FWR Media Posted July 29, 2012 Share Posted July 29, 2012 Coding is a looooooooot of coffe... and snacks... :) Wondered why I was putiing on weight and feeling hyper :) Quote Ultimate SEO Urls 5 PRO - Multi Language Modern, Powerful SEO Urls KissMT Dynamic SEO Meta & Canonical Header Tags KissER Error Handling and Debugging KissIT Image Thumbnailer Security Pro - Querystring protection against hackers ( a KISS contribution ) If you found my post useful please click the "Like This" button to the right. Please only PM me for paid work. Link to comment Share on other sites More sharing options...
MTG Mania Posted July 29, 2012 Author Share Posted July 29, 2012 Wondered why I was putiing on weight and feeling hyper :) You and me both!! Quote Link to comment Share on other sites More sharing options...
Kyle88 Posted August 27, 2012 Share Posted August 27, 2012 Hi Cindy, best is to upload a new package with comments on what's fixed, how and where. So, zip your version and upload with a new number. Sara Coding is a looooooooot of coffe... and snacks... :) I doesn'e look like the new updated files were ever uploaded to the site, because it looks like the most recent version, 6.1b , was added back on February 16, 2012. Would be great if the updated files could be added by somebody ... I could really use it right now! Quote Link to comment Share on other sites More sharing options...
videod Posted September 27, 2012 Share Posted September 27, 2012 Thanks Jim and Jim! This also fixed a checkout problem with OSC 2.3.3 and PHP 5.3 in the /catalog/includes/classes/xml_5.php file. It took me a while to find this thread, but glad I did. Thanks again, Dave Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.