I have a shopping system, that has several $ command but it will not work. I can use $_GET command however, but the other command is much easier to use and remember.
Are there anyone who can explain why i can't use then $ command anymore?
Change "register_globals" to "ON" in you php.ini. It's not recommended, since anyone can set values for your internal variables. Be careful to initialize *every* variable before you use it if you do this.
As well as making your code more secure (see the link provide by aardvark92 above), use of the superglobals[ul][li]makes your code more portable. The superglobals are always available (assuming PHP version > 4.1.0), whereas the "field" variables may not be, depending on configuration.[/li][li]more maintainable. With a complex script, six months from now you may have no idea how the value got into $foo. But $_POST['foo'] is pretty obvious.[/li][/ul]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.