Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
04-20-2004, 06:14 AM #1
- Join Date
- Nov 2002
- Thanked 0 Times in 0 Posts
difference between _POST[somevariable] and somevariable
if i have one page with <form action='nextpage.php' method=post> and it has a text field named somevariable, in the nextpage.php i wana use this variable, what is the difference between calling this variable somevariable and _POST[somevariable]?
04-20-2004, 09:14 AM #2
somevariable will work only with register_globals on, $_POST[variablename] will work with register_globals on or off. Since php4.2, by default, register_globals have been turned off by default. Not only is it easier to understand the code using the super globals, but it's also more secure as $_POST[variable] will only work if the form has been POSTed and can't be altered by GET or a session or whatever. (unless you've coded it to change)