Skip to main content


Showing posts from September, 2012

Trim All Posted Variables in PHP

Quick tip to trim all posted variables in PHP. <?php                          array_walk($_POST, 'trim_posted_variables');                        /**             * function to trim all the posted variables.             *             * $param : value - as we are using array_walk function, first parameter             * in the used function should be value.             * index - second parameter should be key or index.              */                         function trim_posted_variables($value, $index){                   $_POST[$index] = trim($value);                 } ?> Thanks!!!!!!!!!!!! Enjoy Programming :)

Migrate existing FB Apps to another account

Recently, one of my friend asked me the question that he wants to migrate all of his FB Apps to another FB account, how he can do it? Solution is simple. May be most of you are already aware of that but I thought of sharing it on my blog. Following are the steps to migrate one FB App to another account. 1) Go to your developers account and check the page 2) From left panel select the app you want to migrate to another account. 3) Your selected App details will get populated on right side panel. Under Roles section click on 'Edit Roles' link. 4) A new window will open. Under Administrators tab click on add button and select other account name where you want to migrate this App (So another account holder should be in your friend list by default). Note : Please make ensure that the other account is verified one. 5) Now the FB app has two administrators and both administrators can do anything. Even one can remove other ad

CakePHP code not working on Production Server?

Today when I was preparing myself for tomorrow’s project demo uploaded whole project code on production server. But something strange happened; code was not working as expected. But same code was working fine on my local system. Just noticed that no validation was working and database related functions were also not working fine. Searched over internet and stackoverflow but didn’t answer that could rectify my problem. I thought may be it happened due to Auth component I used. But again if it’s working on local system then it should also work on production server. Keep searching and finally got a blog where I got the proper answer. I did a mistake actually so I was the only culprit. For model names I used different nomenclature. For users table I used User.php as model file name instead of user.php and so on. When I did those changes everything worked fine. So please keep it mind that model file name should be e.g user.php (all small characters) format.  Thanks!!!!!!!!! Enjoy Progr