SunQuest
           Programming Theory
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesProgramming Theory

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old February 7th, 2004, 07:18 PM
Andrew's Avatar
Andrew Andrew is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,937 Andrew User rank is Private First Class (20 - 50 Reputation Level)Andrew User rank is Private First Class (20 - 50 Reputation Level)  Folding Points: 2429 Folding Title: Novice Folder
Time spent in forums: 4 Days 1 h 57 m 37 sec
Reputation Power: 3
Orkut
Setting Register Globals to on

Hey i have come across this code, it claims to be able to set register globals or any other variable in the php.ini file, if you dont have access to the php.ini file.

ini_set('register_globals', 'on');

Anyone know the advantages/dis-advantages to using this?

Reply With Quote
  #2  
Old February 7th, 2004, 07:46 PM
brewthatistrue brewthatistrue is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: CA, USA
Posts: 277 brewthatistrue User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 38 sec
Reputation Power: 2
RE: Setting Register Globals to on

it doesn't always work.
don't rely on it.

Reply With Quote
  #3  
Old February 7th, 2004, 09:24 PM
Andrew's Avatar
Andrew Andrew is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,937 Andrew User rank is Private First Class (20 - 50 Reputation Level)Andrew User rank is Private First Class (20 - 50 Reputation Level)  Folding Points: 2429 Folding Title: Novice Folder
Time spent in forums: 4 Days 1 h 57 m 37 sec
Reputation Power: 3
Orkut
RE: Setting Register Globals to on

i know it doesnt but does anyone actually know in what situations it doesnt?

Reply With Quote
  #4  
Old February 7th, 2004, 09:32 PM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: Setting Register Globals to on

It doesnt work when PHP is set up for scripts to not control environment variables.

Reply With Quote
  #5  
Old February 7th, 2004, 09:48 PM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: Setting Register Globals to on

it doesn't work, period.

(doesn't work as in NEVER).

Reply With Quote
  #6  
Old February 8th, 2004, 01:01 AM
postalcow postalcow is offline
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Ford CIty, PA USA
Posts: 1,267 postalcow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via Yahoo to postalcow
Happy Birthday xs0


Quote:
it doesn't work, period.

(doesn't work as in NEVER).


Zombie,

I am not sure I understand what you are saying, could you be a little clearer.

Reply With Quote
  #7  
Old February 8th, 2004, 06:50 AM
tkarkkainen's Avatar
tkarkkainen tkarkkainen is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: Finland
Posts: 2,320 tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 12288 Folding Title: Novice Folder
Time spent in forums: 6 Days 8 h 50 m 48 sec
Reputation Power: 4
RE: RE: Setting Register Globals to on


Quote:
it doesn't work, period.

(doesn't work as in NEVER).


It does! I've succesfully used ini_set() many times. Not for register_globals but other environment variables.

Reply With Quote
  #8  
Old February 8th, 2004, 09:20 AM
nawlej nawlej is offline
Contributing User
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: Dallas, Tx. USA
Posts: 2,008 nawlej User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 7 m 51 sec
Reputation Power: 4
RE: Setting Register Globals to on

I think what zombie is trying to say is that register_globals cant be turned on by ini_set() Not necessarily others.

Reply With Quote
  #9  
Old February 8th, 2004, 10:24 AM
Andrew's Avatar
Andrew Andrew is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,937 Andrew User rank is Private First Class (20 - 50 Reputation Level)Andrew User rank is Private First Class (20 - 50 Reputation Level)  Folding Points: 2429 Folding Title: Novice Folder
Time spent in forums: 4 Days 1 h 57 m 37 sec
Reputation Power: 3
Orkut
RE: Setting Register Globals to on

ok ini_set() is still a good function even if it cant change register gobals. I think it can only change enviromental variables which are set to either 1 or 0 not on or off.

Reply With Quote
  #10  
Old February 8th, 2004, 10:50 AM
tkarkkainen's Avatar
tkarkkainen tkarkkainen is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: Finland
Posts: 2,320 tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)tkarkkainen User rank is Lance Corporal (50 - 100 Reputation Level)  Folding Points: 12288 Folding Title: Novice Folder
Time spent in forums: 6 Days 8 h 50 m 48 sec
Reputation Power: 4
RE: Setting Register Globals to on

AFAIK it can set any environment variables. And 1 & 0 is the same as true & false which is the same as on and off. But others work too. I once played around with the highlight string colors and my script used ini_set() to do it. And color codes aren't just 1 and 0.

Reply With Quote
  #11  
Old February 8th, 2004, 11:17 AM
Andrew's Avatar
Andrew Andrew is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,937 Andrew User rank is Private First Class (20 - 50 Reputation Level)Andrew User rank is Private First Class (20 - 50 Reputation Level)  Folding Points: 2429 Folding Title: Novice Folder
Time spent in forums: 4 Days 1 h 57 m 37 sec
Reputation Power: 3
Orkut
RE: Setting Register Globals to on

The reason i came to my above conclusion was that i have seen many examples of ini_set() but all of them use 1 and 0 so i assumed they wherent like true/false and on/off thanks for informing me they are the same.

Reply With Quote
  #12  
Old February 8th, 2004, 06:03 PM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: Setting Register Globals to on

of course i was saying that ini_set() doesn't work for register globals. if it didn't work at all, why would that function even exist?

and if you think about it, it is quite logical that it doesn't work. global variables are populated by php interpreter before your script is run, so before you can call ini_set().

it doesn't work for any setting that affects things that are done before your script is run. like maximum upload file size, and similar..

Quote:
Zombie,

I am not sure I understand what you are saying, could you be a little clearer.


i know you are joking, but you see that i did need to explain evem more

Reply With Quote
  #13  
Old February 9th, 2004, 06:36 AM
GPX GPX is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Haifa, Israel
Posts: 10 GPX User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Setting Register Globals to on

There is a list of stuff that ini_set can change on the manual www.php.net/ini_set

Reply With Quote
  #14  
Old February 10th, 2004, 06:42 AM
Andrew's Avatar
Andrew Andrew is offline
Moderator
Click here for more information
 
Join Date: Apr 2007
Location: United Kingdom
Posts: 1,937 Andrew User rank is Private First Class (20 - 50 Reputation Level)Andrew User rank is Private First Class (20 - 50 Reputation Level)  Folding Points: 2429 Folding Title: Novice Folder
Time spent in forums: 4 Days 1 h 57 m 37 sec
Reputation Power: 3
Orkut
RE: Setting Register Globals to on

I use ini set to specify sessions dont use cookies on my site. And its quite handy for that.

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesProgramming Theory > Setting Register Globals to on


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |