How to add new side menus in Joomla – a beginners guide






One of the most common admin job of a joomla developer is to add new sideboxes. It is an easy boring job that takes quite bit of time and more boring if you have a slow connection as I have. Following are the steps you need to follow to setup a new side menu: Go […]

5 Comments

Practice writing clean and simple code






I remember the 1st year school days in SUST when I started writing code in pascal. A simple prime number generation program lasted in 100 lines script :), I added and I commented off, and finally when the script is ready, I used to find 70% code that are commented off. That was a time […]

1 Comment

Where to check if PHP mail() function is not working






Lots of time we find php mail() function is not working. In some cases, the email is not sent even the function returns true. Following are the points you may check while debugging: First check if the sendmail_path variable is set properly. You can see it from echo – ing phpinfo() in a page. The […]

,

8 Comments

How to add new sidebox in Zencart






A very common question comes into mind of zencart freshers is how they can add a new sidebox with their own content. It might be new banners, or may be a custom newsletter section or may be a google ad. People search the codes like crazy and again ends up adding some hard-coded html/php garbage […]

, ,

5 Comments

Debug old IE versions in a single tool






Internet Explorer is always a pain in the arse for web developers. One new release and one additional pain. Worst part is it is difficult to debug in all the version in a single machine. At last Microsoft has shown some brain in IE8 by adding IE7 compatibility mode and a developers tool. Despite of […]

, , ,

1 Comment

Beginners guide to Zencart programming






People, who have tried to edit the code of Zencart for the first time, naturally face difficulties to find the right place to put their patches. They end up with hardcoded links, language dependent texts, at the worst case a new database connetion to pull data from database. The same happened to me when I […]

, , ,

18 Comments

Zend optimizer installation problem






Sometime we find that after successful installation of Zend optimizer, php seems do not find it. I have found a common problem that people usually face while installing zend optimizer in a linux server. While installing, Zend optimizer asks for the directory location of current php.ini file. It comes with a default value like /usr/local/Zend/etc […]

No Comments

Access files in password protected directory using curl






I had to get a page that is in a password protected directory. First I used php file_get_contents() which is always my first solution for accessing remote pages. But many web servers disable allow_url_fopen in php config. So curl is the ultimate solution. Curl has an option called CURLOPT_USERPWD that allows to add the user […]

, , ,

2 Comments

Find duplicate entry in table






This is a very handy query all the db programmers and db admins need everyday. Lets say, we have a table “test” with 2 fields “id” and “name”. We need to find out which names are duplicated in the table. So here is the query: select name, count(*) from test group by name having count(*) […]

, ,

6 Comments

Ridirect http://yoursite.com/index.php to http://yoursite.com






Sometimes we need to 301 redirect the index.php file to the domain root as they are canonical urls (ie, http://yoursite.com/index.php and http://yoursite.com are same). It is only tricky for sites using index.php as the common entry with GET variables controlling the site . In that case we cannot redirect pages with any query string (anything […]

, , ,

No Comments