PHP tips :
1. Don’t use spaces to format your code, use tabs. Every space takes up 1 byte, every tab takes up 1 byte too. So if you are using 4 spaces to make 1 tab, you will have added unnecessary bulk (and CPU time) to your code.
2. If you are dealing with external variables through get/post. Always use $_POST[’variable’] or $_GET[’variable’]. Assuming $variable can open a huge security hole into your script. With the upgrade to PHP5, register_globals is turned off, by default - so scripts will be forced to use the above method.
Here is a code snippet to quickly gather $_GET and $_POST variables:
// $_POST[’form_name’] = ‘Sample’;
foreach ($_POST as $key => $value)
$$key = $value;
// Now $form_name = ‘Sample’;
