By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,748 Members | 1,427 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,748 IT Pros & Developers. It's quick & easy.

setting register_globals

P: n/a
Hi,
In the setting of my host, the variable register_globals is set to On,
I like to set it to Off in my solution, is it possible?
I've tried in my code: ini_set("register_globals","0");
but it doesn't work...
Thanks for your help.
Jul 17 '05 #1
Share this Question
Share on Google+
9 Replies


P: n/a
On Wed, 21 Apr 2004 10:50:03 -0400, toufik toufik wrote:
In the setting of my host, the variable register_globals is set to On,
I like to set it to Off in my solution, is it possible?
I've tried in my code: ini_set("register_globals","0");
but it doesn't work...


It will work, if set in httpd.conf, php.ini or .htaccess

It can't be set in user scripts...

--
mvh/regards
Joachim Mæland

If everything seems under control, you're just not going fast enough.
-Mario Andretti

Jul 17 '05 #2

P: n/a
*** toufik toufik wrote/escribió (Wed, 21 Apr 2004 10:50:03 -0400):
In the setting of my host, the variable register_globals is set to On,
I like to set it to Off in my solution, is it possible?
I've tried in my code: ini_set("register_globals","0");
but it doesn't work...


In recent versions it is a per-host setting. Maybe you can change it in
..htaccess (that depends on general security settings):

php_admin_flag register_globals off
--
--
-- Álvaro G. Vicario - Burgos, Spain
--
Jul 17 '05 #3

P: n/a
Thanks friends,
But can you explain more, where to put this file? ist it .htaccess or
xxxx.htaccess?
can you please give me an example?

Thanks

"Alvaro G Vicario" <al******************@telecomputeronline.com> wrote in
message news:bx*****************************@40tude.net...
*** toufik toufik wrote/escribió (Wed, 21 Apr 2004 10:50:03 -0400):
In the setting of my host, the variable register_globals is set to On,
I like to set it to Off in my solution, is it possible?
I've tried in my code: ini_set("register_globals","0");
but it doesn't work...


In recent versions it is a per-host setting. Maybe you can change it in
.htaccess (that depends on general security settings):

php_admin_flag register_globals off
--
--
-- Álvaro G. Vicario - Burgos, Spain
--

Jul 17 '05 #4

P: n/a
*** toufik toufik wrote/escribió (Wed, 21 Apr 2004 12:13:42 -0400):
But can you explain more, where to put this file? ist it .htaccess or
xxxx.htaccess?
can you please give me an example?


It's a text file you put in any web folder and affects to that folder and
its subfolders. You normally place it in your web root. File name is
".htaccess" (without quotes). Syntax is simple: one directive per line.

--
--
-- Álvaro G. Vicario - Burgos, Spain
--
Jul 17 '05 #5

P: n/a
Thanks,
I've tried it, I can Upload but it gives me an internel error when I access
my webSite in the browser

I've tried 2 ways that I copied from the intenet

1st way:
<IfModule mod_php4.c>
php_value register_globals "no"
</IfModule>

2nd way:
php_admin_flag register_globals off

can you please give me the exact syntax of the text inside this file

Thanks.

"Alvaro G Vicario" <al******************@telecomputeronline.com> wrote in
message news:10*******************************@40tude.net. ..
*** toufik toufik wrote/escribió (Wed, 21 Apr 2004 12:13:42 -0400):
But can you explain more, where to put this file? ist it .htaccess or
xxxx.htaccess?
can you please give me an example?


It's a text file you put in any web folder and affects to that folder and
its subfolders. You normally place it in your web root. File name is
".htaccess" (without quotes). Syntax is simple: one directive per line.

--
--
-- Álvaro G. Vicario - Burgos, Spain
--

Jul 17 '05 #6

P: n/a
In article <At********************@news20.bellglobal.com>,
"toufik toufik" <to*****@sympatico.ca> wrote:
Thanks,
I've tried it, I can Upload but it gives me an internel error when I access
my webSite in the browser

I've tried 2 ways that I copied from the intenet

1st way:
<IfModule mod_php4.c>
php_value register_globals "no"
</IfModule>

2nd way:
php_admin_flag register_globals off

can you please give me the exact syntax of the text inside this file

Thanks.


This one works for me:

<IfModule mod_php4.c>
php_flag register_globals on
</IfModule>
JP

--
Sorry, <de*****@cauce.org> is een "spam trap".
E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.
Jul 17 '05 #7

P: n/a
Sorry, doesn't work

my host has the version php4.1.2...

Any hint please??

"Jan Pieter Kunst" <de*****@cauce.org> wrote in message
news:de***************************@news1.news.xs4a ll.nl...
In article <At********************@news20.bellglobal.com>,
"toufik toufik" <to*****@sympatico.ca> wrote:
Thanks,
I've tried it, I can Upload but it gives me an internel error when I access my webSite in the browser

I've tried 2 ways that I copied from the intenet

1st way:
<IfModule mod_php4.c>
php_value register_globals "no"
</IfModule>

2nd way:
php_admin_flag register_globals off

can you please give me the exact syntax of the text inside this file

Thanks.


This one works for me:

<IfModule mod_php4.c>
php_flag register_globals on
</IfModule>
JP

--
Sorry, <de*****@cauce.org> is een "spam trap".
E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.

Jul 17 '05 #8

P: n/a
In article <QN********************@news20.bellglobal.com>,
"toufik toufik" <to*****@sympatico.ca> wrote:
Sorry, doesn't work

my host has the version php4.1.2...

Any hint please??


There is an AllowOverride directive in Apache's central httpd.conf file
which sets what local .htaccess files are permitted to do. It could be
that the AllowOverride in the httpd.conf file is too restrictive.

JP

--
Sorry, <de*****@cauce.org> is een "spam trap".
E-mail adres is <jpk"at"akamail.com>, waarbij "at" = @.
Jul 17 '05 #9

P: n/a
*** toufik toufik wrote/escribió (Wed, 21 Apr 2004 14:09:54 -0400):
Sorry, doesn't work

my host has the version php4.1.2...


Please note that this should not necessarily work for you, even in your
syntax is correct. You need that the server supports "php_admin_flag
register_globals" for virtual hosts and you need that server admin gave
your host the appropriate permissions. I have a test server (Apache 1.3.27
+ PHP 4.1.2) where this won't work at all, while in my production server
(Apache 2.0.40 + PHP 4.2.2) it works fine.

--
--
-- Álvaro G. Vicario - Burgos, Spain
--
Jul 17 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.