![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Apr 2005
Posts: 3
Rep Power: 0
![]() |
Register Globals Question
Hello!
I have this simple form script: And I was wondering how do I turn off the register globals. And is it really necessary to do so? What difference does it make? |
|
|
|
|
|
#2 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
It greatly enhances the security of your system. For example, if you have a variable called $authorised, someone could override it by placing ?authorised=1 into the address bar, therefore creating both $_GET['authorised'] and $authorised, and setting them both to 1. If you turn register_globals off, only the first is created. You can do this by opening php.ini, finding it and setting it to Off, and restarting your webserver.
|
|
|
|
|
|
#3 |
|
Newbie
Join Date: Apr 2005
Posts: 3
Rep Power: 0
![]() |
Hmmm, Yeah, where do I get the php.ini file? And I have to upload it on my server, right?
|
|
|
|
|
|
#4 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Your server has register_globals turned on!?!?! In that case, create a file called ".htaccess" (including the dot), and put the following inside it:
php_flag register_globals 0 |
|
|
|
|
|
#5 |
|
Programming Guru
![]() |
are you hosting the server yourself or is it from a web hosting company?
|
|
|
|
|
|
#6 |
|
Newbie
Join Date: Apr 2005
Posts: 3
Rep Power: 0
![]() |
Its a web hosting company, so I upload my files via FTP
|
|
|
|
|
|
#7 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
Try .htaccess then.
|
|
|
|
|
|
#8 |
|
Programming Guru
![]() |
i doubt he will be able to change it, damn hosting companies
|
|
|
|
|
|
#9 |
|
I eat cake for breakfast.
![]() ![]() ![]() ![]() Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9
![]() |
In that case, I suggest firing off an email to your hosting company explaining exactly why it should be turned off - you can take a look at http://www.php.net/register_globals/ to find out yourself.
|
|
|
|
|
|
#10 |
|
Programming Guru
![]() ![]() ![]() |
Hmmm. I wonder if I forgot to turn mine off... lol Are they turned off by default?
__________________
http://jasonpowers.net "There are a thousand hacking at the branches of evil to one who is striking at the root." |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|