Вы находитесь на странице: 1из 2

Ask your host to enable register_globals=on (in your v-host php.ini file) for your site.

This is
required and they SHOULD do it on request. POST here or PM me if they give you trouble.

Line 365
register_globals = Off
change to
register_globals = On
Note:
1. As jpf said - you must restart / reboot for the change to take effect!
2. Lines in php.ini beginning with ; are comments fyi. There are a few comments about
register_globals = On in the file.
Find & change the line 365 or thereabouts - the one without the ; & reboot.
I had the same problem and I found out a solution. Im running an Apache server within a
Windows machine. I load the php module with the next two lines:
LoadModule php4_module "c:/php/sapi/php4apache2.dll"
AddType application/x-httpd-php .php
Now, if you want to enable the globals, write after those previous lines the next:
php_value register_globals 1
I just use a .htaccess file with this in it:
php_flag register_globals on
Tracy Gibson
That ONLY works if the HOST has register_globals=on in there main php.ini - but turned off as
a default (in https.conf) in all virual domains - and allow change (via htaccess).
It does not ALWAYS work as some hosts DON'T allow this ON without there permission

Perhaps the most controversial change in PHP is when the default value for the PHP directive
register_globals went from ON to OFF in PHP 4.2.0. Reliance on this directive was quite common
and many people didn't even know it existed and assumed it's just how PHP works. This page will
explain how one can write insecure code with this directive but keep in mind that the directive itself
isn't insecure but rather it's the misuse of it.
When on, register_globals will inject (poison) your scripts will all sorts of variables, like request
variables from HTML forms. This coupled with the fact that PHP doesn't require variable initialization
means writing insecure code is that much easier. It was a difficult decision, but the PHP community
decided to disable this directive by default. When on, people use variables yet really don't know for
sure where they come from and can only assume. Internal variables that are defined in the script
itself get mixed up with request data sent by users and disabling register_globals changes this.

turning register globals on should be avoided as far as possible....


having register_globals set to OFF, a variable say $foobar will not have a value unless and
untill
Code:
$foobar=$HTTP_POST_VARS[foobar];

$foobar is null.
php5 by default will have register globals turned off and from the looks of it, it COULD be even
deprecated...

Your getting the error message because register_global is disabled in


" php.ini " file.
You can locate the file :
C:\Windows\php.ini
Open php.ini in any text editor program and look for this section
;;;;;;;;;;;;;;;;;
; Data Handling ;
;;;;;;;;;;;;;;;;;
/--Some other codes ....
; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
register_globals = Off
--/
You will see " register_globals = Off " set to Off , just replace that with
register_globals = On
And your set to go

Вам также может понравиться