Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Register globals easy


leveera

Recommended Posts

This is only thing left that I need to figure out a resolution on. Everything else is working perfect. This doesnt affect the functionality of the site, to my knowledge, just annoying error at the bottom of the page. Im sure the search engines penalize for this, cause it has been indexed. Anyone have any ideas.

 

 

Warning: Invalid argument supplied for foreach() in /home/***/public_html/includes/functions/sessions.php on line 199

 

QUOTE (IrOnGaTe @ May 9 2008, 02:34 PM)

 

 

i have the exact same problem,

 

 

CODE

 

 

 

and on the bottom of my page:

 

 

CODE

 

 

 

so no one notices this problem? it does disappear, but the error does still show up every once in a while

Link to comment
Share on other sites

  • Replies 53
  • Created
  • Last Reply

Top Posters In This Topic

Hi

I have installed this contribution and all worked well apart from I cannot paypal express to work - the session is getting lost.

The only cluse I can find is that I have lots of:

 

[Fri Jun 13 06:49:29 2008] [error] [client 67.195.51.180] PHP Warning: Invalid argument supplied for foreach() in /var/www/html/includes/functions/sessions.php on line 110

 

in the httpd log file.

 

This is in one of the modified areas:

 

// Register Globals MOD - http://www.magic-seo-url.com

function tep_session_close() {

foreach($_SESSION as $key => $value) {

global $$key;

$_SESSION[$key] = $$key;

}

}

 

Any ideas what I have done wrong?

Is this relevant to my paypal problem?

 

Thanks

Pete

Link to comment
Share on other sites

  • 3 weeks later...

I have a HEAVILY modified version of OSC and my hosting provider just upgraded to PHP5 and MySQL5.

 

I installed this contribution and everything worked except some of these session errors. I just tried a litle experiment that seemed to work so far.

 

I just used the session.php files (catalog and admin) from the 2.2rc2a download (along with what was already installed from this contribution) and everything looks good.

 

 

Hope this helps someone else.

 

 

 

 

Hi

I have installed this contribution and all worked well apart from I cannot paypal express to work - the session is getting lost.

The only cluse I can find is that I have lots of:

 

[Fri Jun 13 06:49:29 2008] [error] [client 67.195.51.180] PHP Warning: Invalid argument supplied for foreach() in /var/www/html/includes/functions/sessions.php on line 110

 

in the httpd log file.

 

This is in one of the modified areas:

 

// Register Globals MOD - http://www.magic-seo-url.com

function tep_session_close() {

foreach($_SESSION as $key => $value) {

global $$key;

$_SESSION[$key] = $$key;

}

}

 

Any ideas what I have done wrong?

Is this relevant to my paypal problem?

 

Thanks

Pete

Link to comment
Share on other sites

I have a HEAVILY modified version of OSC and my hosting provider just upgraded to PHP5 and MySQL5.

 

I installed this contribution and everything worked except some of these session errors. I just tried a litle experiment that seemed to work so far.

 

I just used the session.php files (catalog and admin) from the 2.2rc2a download (along with what was already installed from this contribution) and everything looks good.

 

 

Hope this helps someone else.

 

You are a star! It worked. I will keep monitoring and let you know what happens

Thanks

Pete

Link to comment
Share on other sites

encounter an error after updating with his plugin thanks

 

Fatal error: Cannot re-assign $this in /home/mverte/public_html/tienda/admin/includes/classes/upload.php on line 31

Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

ok.. so I installed this contribution on my existing store.

 

http://protrainer-online.com/osc

 

however.. when I try to click on any of the categories I get this error..

 

1054 - Unknown column 'p.products_id' in 'on clause'

 

select count(p.products_id) as total from products_description pd, products p left join manufacturers m on p.manufacturers_id = m.manufacturers_id, products_to_categories p2c left join specials s on p.products_id = s.products_id where p.products_status = '1' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '1' and p2c.categories_id = '22'

 

[TEP STOP]

 

you can see for yourself here.

 

http://protrainer-online.com/osc/index.php?cPath=22

 

what on earth have I done wrong?

Link to comment
Share on other sites

Hi i added latest version Register Globals Off Workaround for PHP4 and PHP5 all works well except i cant get Coupons by Ingo - Fixed & Compiled by Promaetheus (V2.0) to work has anyone any ideas how to get this to work or should i post in the coupons support if there is one?

Link to comment
Share on other sites

and it seems to do the same sort of thing here..

 

http://protrainer-online.com/osc/advanced_...amp;x=0&y=0

 

same sort of error

 

I see your getting a 1054 error see below

 

i got the solutions from osc forum:

credit to the author. this will solve the problem easily.

mostly no need to edit the advanced search result file.

this also aplicable to oscommerce and zencart.

hope it helps !!

==============

 

the 5th response down was very clear cut, and worked like a charm. Of course, then I had an error come up with the search function, but it was also clearly explained further down on the same page. Here are the fixes for those that might need them in the future:

 

First, open "index.php" in an html editor and do this:

 

QUOTE

1. If you have searched and replaced all the p.products_id = s.products_id with p2c.products_id = s.products_id and are getting the error: 1054 - Unknown column 'p2c.products_id' in 'on clause' then look for the line (NOTE: there are two lines starting with //We show them all comment you want the first one.)

 

// We show them all

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";

 

and change it to:

// We show them all

$listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";

 

2. If you are getting 1054 - Unknown column 'p.products_id' in 'on clause' then replace p.products_id = s.products_id with p2c.products_id = s.products_id EXCEPT on the line specified in #1 above.

 

 

Then open "advanced_search_results.php" in an html editor and do this:

 

QUOTE

I change this code:

$from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";

 

with:

$from_str = "from ((" . TABLE_PRODUCTS . " p) left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd) left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";

Link to comment
Share on other sites

Hi i added latest version Register Globals Off Workaround for PHP4 and PHP5 all works well except i cant get Coupons by Ingo - Fixed & Compiled by Promaetheus (V2.0) to work has anyone any ideas how to get this to work or should i post in the coupons support if there is one?

 

 

Update i got it working, great mod, well done on the work you did for this contributions :)

Link to comment
Share on other sites

Hi all,

 

When iam using this contribution i can start the install steps

 

But at the last step it goes wrong, see the error messages below:

 

 

Warning: fopen(xxx.nl/HTML/includes/configure.php) [function.fopen]: failed to open stream: No such file or directory in /var/www/g4603/xxx.nl/HTML/install/templates/pages/install_7.php on line 209

 

Warning: fputs(): supplied argument is not a valid stream resource in /var/www/g4603/xxx.nl/HTML/install/templates/pages/install_7.php on line 210

 

Warning: fclose(): supplied argument is not a valid stream resource in /var/www/g4603/xxx.nl/HTML/install/templates/pages/install_7.php on line 211

 

Warning: fopen(xxx.nl/HTML/admin/includes/configure.php) [function.fopen]: failed to open stream: No such file or directory in /var/www/g4603/xxx.nl/HTML/install/templates/pages/install_7.php on line 259

 

Warning: fputs(): supplied argument is not a valid stream resource in /var/www/g4603/xxx.nl/HTML/install/templates/pages/install_7.php on line 260

 

Warning: fclose(): supplied argument is not a valid stream resource in /var/www/g4603/xxx.nl/install/templates/pages/install_7.php on line 261

 

 

The configuration was successful

 

Does any one knows what goes wrong here? And how to fix it?

 

Thanks in advance!

Edited by inctrl
Link to comment
Share on other sites

  • 5 months later...

I am having a problem while testing this mod with my store. I have isolated the problem to the admin config setting of "Check Session ID= true".

 

This mod changes sessions.php and makes the function that registers session variables set the variable to null. This seems to make the session id check in application_top fail and causes any SSL pages to redirect to ssl_check.php.

 

If I set "Check Session ID=false", the problem goes away.

 

Ideally I would like to leave the check session id feature turned on and I am confused as to the purpose of the "_SESSION($variable) = null" in sessions.php.

 

Can someone please enlighten me as to the logic of this change and advise me if there is a workaround to my problem that would allow me to leave the check session id feature set?

 

Thanks!!

Link to comment
Share on other sites

  • 2 weeks later...

We installed this contribution, and it rectifies the site crash effect, with "please enable R_G" warning, but with some loss of admin features.

 

The main problem however, to begin with, all of the store front pages are all preceded with this warning,

 

Warning: eregi() [function.eregi.html]: REG_EMPTY in D:\Domains\autodarkhelmet.co.uk\wwwroot\includes\application_top.php on line 58

 

 

and the script it refers to is :

 

// set the type of request (secure or not)

$request_type = (eregi ($HTTP_HOST,HTTPS_SERVER)) ? 'SSL' : 'NONSSL';

 

The "padlock" is as well missing on SSL enabled pages

 

Can anyone suggest a remedy ?

 

John Det

Link to comment
Share on other sites

hi

 

i am having a problem on, when i click on admin

 

mywebsitesname.com/admin

 

i get this

 

Fatal error: Cannot re-assign $this in /home/jogiasel/public_html/admin/includes/classes/upload.php on line 31

 

? any help please

Link to comment
Share on other sites

put site:http://www.oscommerce.com/forums then error in google & you'll get loads

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

  • 3 months later...

I done every thing in the Workaround and it it didnot make any differance, I still get the following error.

 

Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory

Link to comment
Share on other sites

I done every thing in the Workaround and it it didnot make any differance, I still get the following error.

 

Server Requirement Error: register_globals is disabled in your PHP configuration. This can be enabled in your php.ini configuration file or in the .htaccess file in your catalog directory

I did not find the problem here, but I got information from my server as follows: "This might not work for anyone else, but it worked great for me."

 

You can turn it on for your individual web sites by entering the following into a .htaccess file:

 

php_flag register_globals on

 

The .htaccess file should be in your public_html folder.

Link to comment
Share on other sites

  • 3 weeks later...

I did the Code exchanges, but now i am getting a fatal error:

 

Fatal error: Call to undefined function tep_session_is_registered() in //catalog/includes/application_top.php on line 260

 

Line 260 and down a few.

 

// create the shopping cart & fix the cart if necesary  
if (tep_session_is_registered('cart') && is_object($cart)) {       <--- Line 260
if (PHP_VERSION < 4) {      
$broken_cart = $cart;      
$cart = new shoppingCart;      
$cart->unserialize($broken_cart);    
}  
} else {    
tep_session_register('cart');    
$cart = new shoppingCart;  }

Edited by nchilson
Link to comment
Share on other sites

Hello,

 

I have installed the Register Global Easy and all works well...except the impact in the Mod Cybermut (Visa payment module).

 

When the register global is Off, the customer is ok to order and pay, but the order is not registred in the admin order side.

 

Any idea how this mod could impact a payment module ?

 

Thank you in advance for your support,

 

Best regards

Edited by bienenf
Link to comment
Share on other sites

Perhaps that module is not Register Global Compatible, perhaps u need to look for a better one.

 

Also have u looked at Upgrading osC from 2.2 MS2 to 2.2 RC2a http://addons.oscommerce.com/info/6654

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...