473,385 Members | 2,269 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

turn register_globals off?

I just took over the website at work. I am still learning PHP.
Register_globals are on and the script appears to be coded to take
advantage of this. I know how to recode the script, but am unsure how
to turn them off when I am done. I have googled and came up with
placing

php_flag register_globals off

in the .htaccess file.

I did this without recoding the script and the script still worked, so
I am assuming I did not turn them off. Please help.
Thanks,

Peter

Oct 10 '05 #1
17 2864
Run phpinfo() to see the settings for register_globals.
// script to display contents of phpinfo()
<?php
print(phpinfo());
?>

Oct 10 '05 #2
Yes, I did that and they are ON. When I try to turn them off in
..htaccess, they still show as being ON.

Thanks,

Peter

Oct 10 '05 #3
Well, this is what my .htaccess looks like (change the 4 to a 5, if you
have php5 )
<IfModule mod_php4.c>
php_value register_globals 0
</IfModule>

Oct 10 '05 #4
Ok, I'll give it a try tomorrow at work and see if I have any luck.
Thanks for your help, Kurt!

Peter

Oct 10 '05 #5
On 10 Oct 2005 14:17:46 -0700, "peter" <pl*****@yahoo.com> wrote:
I just took over the website at work. I am still learning PHP.
Register_globals are on and the script appears to be coded to take
advantage of this. I know how to recode the script, but am unsure how
to turn them off when I am done. I have googled and came up with
placing

php_flag register_globals off

in the .htaccess file.

I did this without recoding the script and the script still worked, so
I am assuming I did not turn them off. Please help.
Thanks,

Peter


If you turn register_globals offyou may have to do a huge amount of
recoding your global variables - good luck.

In the php.ini file change the line from:

register_globals = On

to

register_globals = Off

My php.ini is in c:\php - but I am working with Windows.

Oct 11 '05 #6
My website is on a shared hosting setup, so I don't think I will be
able to access php.ini.
Thanks,

Peter

Oct 11 '05 #7
peter wrote:
My website is on a shared hosting setup, so I don't think I will be
able to access php.ini.
Thanks,

Peter


Change hosts. I would *never* host with someone running with
register_globals on.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 11 '05 #8
peter wrote:
My website is on a shared hosting setup, so I don't think I will be
able to access php.ini.


http://in2.php.net/faq.misc#faq.misc.registerglobals

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Oct 11 '05 #9
Hey Rajesh, thanks! I'll try that emulation tomorrow. Nothing else
has worked for me so far. I will consider your advice, Jerry, too.
Thanks!

Peter

Oct 11 '05 #10

"peter" <pl*****@yahoo.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I just took over the website at work. I am still learning PHP.
Register_globals are on and the script appears to be coded to take
advantage of this. I know how to recode the script, but am unsure how
to turn them off when I am done. I have googled and came up with
placing

php_flag register_globals off

in the .htaccess file.

The correct syntax is:

php_value register_globals 0

This will only work if your web host has actually configured Apache to look
in .htaccess files.

--
Tony Marston

http://www.tonymarston.net

Oct 16 '05 #11
Thanks for the proper syntax, Tony. I'm having a hard time getting an
answer out of my hosting company. Is there any reason the hosting
company would object to configuring apache to look in the .htacess
file?

Peter

Oct 16 '05 #12
Some web hosting companies offer a limited service simply because they do
not know any better. Amongst their "substandard" offerings are:
a) a version of PHP which is not the latest.
b) unwilling to include any of the optional PHP extensions.
c) PHP running in safe mode.
d) disallowing the option of htaccess files to change the Apache
configuration at account level.
e) Only one MySQL database.

These are things you should confirm with any hosting company before you sign
up with them. If your present hosting company is unwilling to offer a proper
service then I can only suggest you switch to another one.

--
Tony Marston
http://www.tonymarston.net
"peter" <pl*****@yahoo.com> wrote in message
news:11**********************@g44g2000cwa.googlegr oups.com...
Thanks for the proper syntax, Tony. I'm having a hard time getting an
answer out of my hosting company. Is there any reason the hosting
company would object to configuring apache to look in the .htacess
file?

Peter

Oct 16 '05 #13
"Tony Marston" wrote:
e) Only one MySQL database.


Why's that such a problem?

--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Oct 16 '05 #14
Ok, Tony, thanks for your help!

Peter

Oct 17 '05 #15
Philip Ronan wrote:
"Tony Marston" wrote:

e) Only one MySQL database.

Why's that such a problem?


Putting everything in one database just makes for a huge, unmaintainable
database. Administration of the database can be difficult, also.

Splitting unrelated information into different databases makes
everything easier to maintain and administrate.

For instance - on one of my sites, I'm running several databases. One
is for email - it handles email aliases, boxes, passwords, etc.
Everything the MTA (Exim in this case) needs.

Another database handles administrative functions for the website.
Access control (different people can access different areas of the
website) through the mod_auth_mysql authorization module.

A third database handles the CMS for the variable pages. A fourth one
handles the catalog and ordering.

Each of these databases operates independently from the other databases.
Nothing is common between them (well, maybe someone with an email box
can also have and administrative or CMS function).

This makes things much easier to maintain.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 17 '05 #16

"Philip Ronan" <in*****@invalid.invalid> wrote in message
news:BF78A093.39799%in*****@invalid.invalid...
"Tony Marston" wrote:
e) Only one MySQL database.


Why's that such a problem?

Because my application contains several unrelated projects, and I like to
keep each project's data in its own database. This makes backups and
restores a lot easier. Putting everything into a single database is
counter-intuitive for me.

--
Tony Marston
http://www.tonymarston.net
Oct 17 '05 #17
"Tony Marston" wrote:

"Philip Ronan" <in*****@invalid.invalid> wrote in message
news:BF78A093.39799%in*****@invalid.invalid...
"Tony Marston" wrote:
e) Only one MySQL database.
Why's that such a problem?

Because my application contains several unrelated projects, and I like to
keep each project's data in its own database. This makes backups and
restores a lot easier.


So the more databases you have, the easier it is to back them up...?

OK, if you're working with *lots* of data then maybe it would help to have
the facility to back applications up individually. But for a small website
on a budget host, I can't see the need, TBH.

Actually, on a shared host I think it's probably better to have
c) PHP running in safe mode.


because your server is only as secure as the lamest script running on it,
and you have no control over what everyone else is doing.
--
phil [dot] ronan @ virgin [dot] net
http://vzone.virgin.net/phil.ronan/
Oct 17 '05 #18

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Frank | last post by:
Whats best : register_globals ON ? OR register_globals OFF ? I currently use: $_POST
3
by: Useko Netsumi | last post by:
in php.ini? Thank
6
by: wonder | last post by:
Hi, The CRM application said that need to add an option "REGISTER_GLOBALS=On" to the php.ini file, so I did what it told. But I still can't get rid off the following error: The PHP variable...
2
by: Phil Latio | last post by:
I am newish to PHP and wish to create an authentication system where a new user is required to validate/complete their sign-up by clicking a link in an email. I am probably capable of putting...
15
by: news | last post by:
You'd think it'd be easier to find the answer to this question. Did a search, and all I can find is people asking why something's not working and people replying it's because register_globals is...
12
by: aeldaly | last post by:
Hello all, My shared server provider has register_globals on. I checked by running php_info(); from within a file. I would like to turn this off, but asking them to turn it off just for me will...
4
by: Angelos Devletoglou | last post by:
Hi... It drives me nuts this server. My php.ini says that register_globals is OFF and when I run phpinfo() it says they are ON. I restarted both httpd and the whole server still nothing. IS...
5
by: Samuel Shulman | last post by:
I keep getting the 'FATAL ERROR: register_globals is disabled in php.ini, please enable it!' error I changes that settings and I still get this error What should I do next? Thank you,...
4
by: bnashenas1984 | last post by:
Hi everyone I'v been working on my scripts more that 5 months using Microfoft IIS on windows XP. As default the ( register_globals ) was ON ( php.ini ) and that means I didnt need to use ( $_request...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.