Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 24th, 2005, 4:01 PM   #1
einzelle
Newbie
 
Join Date: Apr 2005
Posts: 3
Rep Power: 0 einzelle is on a distinguished road
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?
einzelle is offline   Reply With Quote
Old Apr 24th, 2005, 4:14 PM   #2
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
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.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Apr 24th, 2005, 4:48 PM   #3
einzelle
Newbie
 
Join Date: Apr 2005
Posts: 3
Rep Power: 0 einzelle is on a distinguished road
Hmmm, Yeah, where do I get the php.ini file? And I have to upload it on my server, right?
einzelle is offline   Reply With Quote
Old Apr 24th, 2005, 6:25 PM   #4
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
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
Then upload that to your server.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Apr 25th, 2005, 3:27 AM   #5
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
are you hosting the server yourself or is it from a web hosting company?
Berto is offline   Reply With Quote
Old Apr 25th, 2005, 5:31 PM   #6
einzelle
Newbie
 
Join Date: Apr 2005
Posts: 3
Rep Power: 0 einzelle is on a distinguished road
Its a web hosting company, so I upload my files via FTP
einzelle is offline   Reply With Quote
Old Apr 25th, 2005, 6:40 PM   #7
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Try .htaccess then.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Apr 26th, 2005, 2:37 AM   #8
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
i doubt he will be able to change it, damn hosting companies
Berto is offline   Reply With Quote
Old Apr 26th, 2005, 1:06 PM   #9
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
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.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Apr 26th, 2005, 1:56 PM   #10
Infinite Recursion
Programming Guru
 
Infinite Recursion's Avatar
 
Join Date: Jul 2004
Location: United States
Posts: 3,467
Rep Power: 8 Infinite Recursion is on a distinguished road
Send a message via MSN to Infinite Recursion Send a message via Yahoo to Infinite Recursion
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."
Infinite Recursion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:58 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC