Jump to content
Sign in to follow this  
leveera

[Contribution] Register globals easy

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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.

 

 

 

 

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


Ack Ack!

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Seems to be working 100%... I'll keep testing, but right now all seems good. :)


I find the fun in everything.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
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?

Share this post


Link to post
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";

Share this post


Link to post
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 :)

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

i have installed Admin access levels with this. you an find that contribution here .but its not working..

 

Plz help me

 

:(


DJS

Share this post


Link to post
Share on other sites

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!!

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

put site:http://forums.oscommerce.com 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.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×