UK WEB HOSTING FORUM FOR DISCUSSION ON WEB HOSTING SERVICE AND SUPPORT
LINUX HOSTING WINDOWS HOSTING PACKAGES SHOPPING CART OSCOMMERCE ZEN CART AGORA
ECOMMERCE HOSTING ASP MSSQL FRONTPAGE HOSTING PHP MYSQL HOSTING DISCUSSION FORUM
CPANEL RESELLER HOSTING DEDICATED SERVER VPS HOSTING PLESK VIRTUOZZO
Quick Search
Your forum announcement here!

  UK Web Hosting | Dedicated Server Windows and Linux VPS Forum > Sales > Suggestions

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-06-2006, 13:02
Premium Member
 
Join Date: May 2006
Location: Cambridgeshire
Posts: 388
Default PHP - Register_Globals

Is it possible for eUKhost to set the 'register_global' module in PHP to "off", as it is currenly set to 'on'. This can be changed in the php.ini file for register_globals = Off. It should really be off for security purposes. It was depreciated in the 4.x versions of PHP, and should not be used. Providing users are coding PHP properly they should not be affected by this change.
Reply With Quote
  #2 (permalink)  
Old 08-06-2006, 21:56
eUKhost.com's Avatar
Chief Marketing Officer
 
Join Date: Sep 2005
Posts: 4,256
Send a message via AIM to eUKhost.com Send a message via MSN to eUKhost.com
Default

Thanks for your suggestion.

We tried this option in past but we were flooded with tickets and chats as many customers had problems with their websites. We've worked out couple of things for security of the servers and mod_security has been very helpful in clearing all threats that may occur due to compromised php pages.
Reply With Quote
  #3 (permalink)  
Old 09-06-2006, 10:55
Premium Member
 
Join Date: May 2006
Location: Cambridgeshire
Posts: 388
Default

Fair enough I suppose.

For reference to get most of the PHP to work all that coders need to add is along the lines of...
Code:
$id=$_GET['id'];
...assuming the bulk of the problems is with URLs such as index.php?id=something.
Reply With Quote
  #4 (permalink)  
Old 10-10-2006, 12:49
Member
 
Join Date: Oct 2006
Location: Nieuwkerken-Waas; Flanders
Posts: 32
Default

Quote:
Originally Posted by Eidolon View Post
Fair enough I suppose.

For reference to get most of the PHP to work all that coders need to add is along the lines of...
Code:
$id=$_GET['id'];
...assuming the bulk of the problems is with URLs such as index.php?id=something.
Is it now on or off? If off, is it allowed to edit a .htaccess file for setting it off?
__________________
Êl síla nan lû e-govaded vín!
Reply With Quote
  #5 (permalink)  
Old 10-10-2006, 13:14
Premium Member
 
Join Date: May 2006
Location: Cambridgeshire
Posts: 388
Default

As far as I'm aware it is currently on, though I'd recommend you code as if it was set to off.
Reply With Quote
  #6 (permalink)  
Old 10-10-2006, 13:28
eUKhost.com's Avatar
Chief Marketing Officer
 
Join Date: Sep 2005
Posts: 4,256
Send a message via AIM to eUKhost.com Send a message via MSN to eUKhost.com
Default

All that you need to add in .htaccess to enable or disable register_globals is as follows :-

to set register_globals on :-
php_flag register_globals on

to set register_globals off :-
php_value register_globals off

Dont try both at a time as that would create problems for your php scripts / applications.
__________________
UK Web Hosting || Business Hosting || eUKhost Knowledgebase
Toll Free : 0808 262 0255 || MSN : mark @ eukhost.com || AIM : eukmark
A bunch of Sheep led by a Lion is better than a bunch of Lions led by a Sheep.
__________________________________________________

Great Opportunity :: Join our Affiliate Program for FREE and earn 20% commission on each referral.
Reply With Quote
  #7 (permalink)  
Old 20-10-2006, 10:13
Premium Member
 
Join Date: Sep 2006
Posts: 80
Default

As much as I agree normally it causes mass scucide as new php developers suddenly find there website gets broke very quickly.

I dont use register_globals anymore but a lot of my very early php 4 work was written with ignorance to register globals so that makes me partly guilty

With PHP6 they have removed the option altogether but I do agree that new servers should have the option forced to off to encourage developers to work with it off.
Reply With Quote
  #8 (permalink)  
Old 09-11-2006, 19:26
Junior Member
 
Join Date: Nov 2006
Posts: 13
Default Fix

You must be very carefull if you use register_globals, example:-

if($adminpassword == $upassword){

$admin = "1";

}

if($admin == "1"){
//Display secure information
}

As you can imagine, if the users puts index.php?admin=1 - your website is instantly vulnerable. You must make sure to define all variables at the top of your script (that aren't from a form). A fix for the above script would be just to add $admin = "0"; at the top.

Last edited by Cruisecar : 09-11-2006 at 19:31.
Reply With Quote
  #9 (permalink)  
Old 09-11-2006, 19:58
eUKhost.com's Avatar
Chief Marketing Officer
 
Join Date: Sep 2005
Posts: 4,256
Send a message via AIM to eUKhost.com Send a message via MSN to eUKhost.com
Default

You mean that the code should be as follows :-

$admin = "0";
php_flag register_globals on

Is this what you want to mention ?
__________________
UK Web Hosting || Business Hosting || eUKhost Knowledgebase
Toll Free : 0808 262 0255 || MSN : mark @ eukhost.com || AIM : eukmark
A bunch of Sheep led by a Lion is better than a bunch of Lions led by a Sheep.
__________________________________________________

Great Opportunity :: Join our Affiliate Program for FREE and earn 20% commission on each referral.
Reply With Quote
  #10 (permalink)  
Old 09-11-2006, 22:40
Junior Member
 
Join Date: Nov 2006
Posts: 13
Default

Yeh, I thought you would automaticly assume I meant with it on
Reply With Quote
  #11 (permalink)  
Old 10-11-2006, 00:41
eUKhost.com's Avatar
Chief Marketing Officer
 
Join Date: Sep 2005
Posts: 4,256
Send a message via AIM to eUKhost.com Send a message via MSN to eUKhost.com
Default

I am not good with php so I could not make out what exactly it should be.

I'll bookmark this thread as it can help me in future when I become a good developer
__________________
UK Web Hosting || Business Hosting || eUKhost Knowledgebase
Toll Free : 0808 262 0255 || MSN : mark @ eukhost.com || AIM : eukmark
A bunch of Sheep led by a Lion is better than a bunch of Lions led by a Sheep.
__________________________________________________

Great Opportunity :: Join our Affiliate Program for FREE and earn 20% commission on each referral.
Reply With Quote
  #12 (permalink)  
Old 10-11-2006, 09:15
Member
 
Join Date: Oct 2006
Location: Nieuwkerken-Waas; Flanders
Posts: 32
Default

Quote:
Originally Posted by eukhost.com View Post
You mean that the code should be as follows :-

$admin = "0";
php_flag register_globals on

Is this what you want to mention ?
Well, if you put that second line in your .htaccess (or not if on is the default option) and use the first line in your script, it will be safe.
But then you have to do that for all your variables which is more work and if you forget one, the whole script can become unsafe. Simply turn register_globals off is still the most safe thing to do, in that case, you can safly use variables without worrying.
__________________
Êl síla nan lû e-govaded vín!
Reply With Quote
Reply



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

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 00:48.

 

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by Web Hosting 3.1.0
Copyright © 2001-2008, eUKhost.com. All rights reserved.

 
Site Map

knowledgebase articles

popular blog categories