register globals question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Ree
Forum Regular
Posts: 592
Joined: Fri Jun 10, 2005 1:43 am
Location: LT

register globals question

Post by Ree »

If the server has register globals on, will my code work fine? I code with register globals off in mind, so I use $_GET['var'], $_POST['var'] etc.
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Yes, as long as you keep a tight leache on the variables that may be modified..
Remember to always initialize your variables with default values, so that even if the malicious user tries to overwrite certain values his attempt will fail.
Post Reply