View Full Version : Register_globals work around??
Mbroderick
October 31st, 2003, 04:33 PM
Hello again, The ISP that I'm using now has Register_globals turn OFF and I requested for them to be turned on. They can't but he send me the following code. Will this work? If so where do I put in in the code. Is there a better work around?
----------------------
Mike,
Register_globals is turned off for security reasons and cannot be
enabled. However, for scripts that need register_globals on, you can
add the following lines of code to emulate that functionality:
### register_globals = off ### +++
//HTTP_GET_VARS
while (list($key, $val) = @each($HTTP_GET_VARS)) {
$GLOBALS[$key] = $val;
}
//HTTP_POST_VARS
while (list($key, $val) = @each($HTTP_POST_VARS)) {
$GLOBALS[$key] = $val;
}
//HTTP_POST_FILES
while (list($key, $val) = @each($HTTP_POST_FILES)) {
$GLOBALS[$key] = $val;
}
//$HTTP_SESSION_VARS
while (list($key, $val) = @each($HTTP_SESSION_VARS)) {
$GLOBALS[$key] = $val;
}
### register_globals = off ### ---
-------
Thanks for your help again....
Mike
Jamie
November 1st, 2003, 05:54 PM
Hi Mike,
If you add that to the top of your cart page (store.php by default) it should work.
Just make sure you surround it with PHP tags:
<?
your code here
?>
Thanks,
Jamie
Mbroderick
November 3rd, 2003, 12:39 PM
I tried it.
<?
### register_globals = off ### +++
//HTTP_GET_VARS
while (list($key, $val) = @each($HTTP_GET_VARS)) {
$GLOBALS[$key] = $val;
}
//HTTP_POST_VARS
while (list($key, $val) = @each($HTTP_POST_VARS)) {
$GLOBALS[$key] = $val;
}
//HTTP_POST_FILES
while (list($key, $val) = @each($HTTP_POST_FILES)) {
$GLOBALS[$key] = $val;
}
//$HTTP_SESSION_VARS
while (list($key, $val) = @each($HTTP_SESSION_VARS)) {
$GLOBALS[$key] = $val;
}
### register_globals = off ### ---
?>
added this to the top of store.php and it didn't seem to work. I don't recieve an errors, just a blank page.
Did I insert the code correctly?
Here's the phpinfo link. http://dartoidsworldcom.web0210.uplinkearth.com/squirrelcart/phpinfo.php
Mike
Hi Mike,
If you add that to the top of your cart page (store.php by default) it should work.
Just make sure you surround it with PHP tags:
<?
your code here
?>
Thanks,
Jamie
Jamie
November 3rd, 2003, 01:03 PM
Hi,
The code looks fine. If the error reporting on the server is configured a certain way, and you get a fatal error, PHP won't output anything to the browser. It is tough to say what the problem is. I would double check your connection info for your database, as a problem with that could definitely cause that.
If you can't get by it, please open a helpdesk ticket, and we'll check it out for you.
Thanks,
Jamie
Mbroderick
November 4th, 2003, 10:17 AM
FYI: I opened a ticket.
Hi,
The code looks fine. If the error reporting on the server is configured a certain way, and you get a fatal error, PHP won't output anything to the browser. It is tough to say what the problem is. I would double check your connection info for your database, as a problem with that could definitely cause that.
If you can't get by it, please open a helpdesk ticket, and we'll check it out for you.
Thanks,
Jamie
Rich
November 4th, 2003, 10:24 PM
FYI: I opened a ticket.Thank you. It has been received.
Mbroderick
November 6th, 2003, 01:53 PM
I added more details and a responce from my ISP support. Please review.
Thanks
Mbroderick
November 10th, 2003, 01:31 PM
Can you please look at my ticket. Or give me a timeframe on when you can look at the Call ID 633 .
Thanks
Mbroderick
November 11th, 2003, 03:20 PM
Can someone please get back to me on this issues I submited.
Thanks
Jamie
November 11th, 2003, 08:33 PM
Please check your ticket.
Thanks,
Jamie
Mbroderick
November 12th, 2003, 04:30 PM
Thanks, added one more item to the ticket.
Mbroderick
November 12th, 2003, 08:02 PM
Thanks for the responce.
Please check ticket again.
Mike Broderick
Mbroderick
November 14th, 2003, 01:50 PM
New detail in ticket PLEASE review. I have only a few days left on the ISP ( 30 day money back). Still can't upload images and the test program you sent works.
Jamie
November 14th, 2003, 03:02 PM
Hi Mike,
I saw your update. I have no FTP access at the moment, but will check shortly. The ticket system is checked as often as the helpdesk, so please do not ask for updates to tickets here and vice versa. :)
Thanks,
Jamie
lzgsch
December 14th, 2005, 06:04 PM
We have squirrelcart 1.2 store. It requires register_globals to be on. I am changing the hosting company. The new company has register_globals turned off. Does anyone has the resolution for this? Jamie or Rich knows about this? Thank you for any help!
Jamie
December 14th, 2005, 07:36 PM
Hi,
I'd highly recommend upgrading. We don't support v1.2.0 anymore, and there have been many changes made since it's release.
The workaround for register globals is the same as the code above. You can put this at the top of "squirrelcart/cart.php", below the opening <? tag:
// workaround fix for when register_globals is set to off.
if (!ini_get('register_globals')) {
while (list($key, $val) = @each($_GET)) $GLOBALS[$key] = $val;
while (list($key, $val) = @each($_POST)) $GLOBALS[$key] = $val;
while (list($key, $val) = @each($_COOKIE)) $GLOBALS[$key] = $val;
while (list($key, $val) = @each($_FILES)) $GLOBALS[$key] = $val;
while (list($key, $val) = @each($_SESSION)) $GLOBALS[$key] = $val;
}
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.