Register globals

SpaceshipSpaceship
SpaceshipSpaceship
SpaceshipSpaceship
Watch

food_consult

Established Member
Impact
5
Is there a way to code the cart so it doesn't require Register Globals ??

http://www.winecoat.com/



FATAL ERROR: register_globals is disabled in php.ini, please enable it!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
The best would be to rewrite the code so as not depend on specific server settings. So you have code that is portable and more secure.
For example to retrieve the value of form fields use something like:

$var=$_POST['text_field'];
instead of:
$var=$text_field;

http://php.net/register_globals
 
0
•••
Register global emulator:

PHP:
foreach($_POST as $szKey => $szItem)
{
	$$szKey = $szItem;
}
 
0
•••
Alternatively, you can enable register globals in your .htaccess file:

Add this to the bottom of the file:
Code:
php_value register_globals 1

Hope this helps,
Joe
 
0
•••
Or you can try (will not work on some/most servers):

Code:
ini_set('register_globals','On');

Jason
 
0
•••
RegisterRants said:
Or you can try (will not work on some/most servers):

Code:
ini_set('register_globals','On');

Jason


That will not achieve anything. Although this setting can be set in a php file, by the time the file is being executed the work that this setting does has already been carried out.
 
0
•••
Yeah, that's why I said it generally won't work ;) Some really old server softwares (non-Apache) did have file loading that would allow that to work, but I haven't heard of any of those server platforms in ages and have long since forgotten their names ;)

Jason
 
0
•••
register globals doesn't have anything to do with the server software it is how php and the zend engine deals with data it receives.
 
0
•••
To which I'd recommend keeping it disabled anyway.
 
0
•••
Appraise.net

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com
Catchy
URLs.com
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back