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!
I have a little problem. Just switched server and most of my code is broken due to a lot of form posted variables being retrived by using its variable name e.g:
I have a little problem. Just switched server and most of my code is broken due to a lot of form posted variables being retrived by using its variable name e.g:
The setting in php.ini is register_globals. This is not safe to have on, especially if your code is not secure.
Rather than looping through the POST data, you can use that functions that were designed for this: import_request_variables() or extract(). This is just as insecure as register_globals though.
The loop is only handy if you do some validation/sanitizing there, which is probably a good idea.
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.