Below is the most commonly used trim prototype/function in javascript. Posting for reference. String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g,””) } You can place the above code (wrapped in <script></script>) inside <header> section of your web page or you can place…
Choosing a business listing directory script written in php
How to Choose a business listing directory script written or coded in PHP programming language I got a new client today who wanted a brand new website equipped with business listing directory feature. According to him, the script should be…
How to update a mysql table with the count of another table while using like statement
While working on a web links directory i wanted to update categories table’s num_listings column with the count of listings under each category. The category id was stored something like this in listings table:
How to create a keyboard shortcut to open an application / program in Windows 7
Following step by step instructions to create a keyboard shortcut to a program in Windows 7.
Template drop down list missing in edit page in wordpress
Last night i installed a new theme to this blog of mine and after setting basic things up when i went to edit my archives page at admin end the Template drop-down in Page Attribute box was missing. Strange. I…
phpMyAdmin PHP Code Injection Exploit attempt on my server
This morning, when i checked my Give Back India site’s access log i found some scripts/setup.php request attempts. In fact, not ‘some’ but hundreds of them. All requests were made targeting phpMyAdmin’ installations on my server. Here are a few…
Converting a text string into comma separated words
Today, i was looking at some old code of mine to find something when i found this little but useful piece of code which i had written for one of my old projects (and of course when i didn’t had…
Changing “Remember Me” text string in user box in Joomla 1.5
I wanted to change “Remember Me” text in the user login box in Joomla 1.5 to just “Remember” so that it should fit with the login button to the right of it while keeping them in same row.
Krishna font text to UTF-8 (Web Content) Converter
I received news documents (.doc files) written in Krishna(Devanagari ) font from my state government’ press release department and i wanted them posted in one of my blog sites, as it is. I posted some of them as it is…
Cakephp important facts you must know – Part 3
You load a plugin model like this: $this->loadModel(“Forum.Topic”) You output requestAction result using $this->requestAction(array(‘controller’ => ‘articles’, ‘action’ => ‘featured’), array(‘return’)); // see array(‘return’)