Content Encoding Error on Firefox

Recently I was getting “Content Encoding Error” while going to access one of my staging site. But my team members are not facing such a problem while accessing this site.

Content encoding error on firefox

After doing some Googling I found a solution. Hope this will help you all…

1) In the address bar type “about:config” (but without the inverted commas)
2) Tell it that you will be careful, Promise!!
3) In the filter type encoding
4) There should be one option reading “network.http.accept-encoding”
5) Click in the value column and type “true” (again without the inverted commas)
6) Restart your browser.

Source(s): Yahoo answers

Leave a comment

Posted by on November 14, 2012 in Uncategorized


Tags: ,

Change title from node add form in Drupal

Changing title from node add/edit form in Drupal is pretty simple. You can do that with Drupal hooks from your custom module. Here is the simplest way to do that

function mymodule_form_alter(&$form, $form_state, $form_id) {
if($form_id == ‘mynodetype_node_form’){
drupal_set_title(t(“Edit My new title”));
drupal_set_title(‘My new title’);

Leave a comment

Posted by on August 12, 2012 in Drupal, PHP, Uncategorized


Set chrome default language to English in Mac

Couple of days ago I have installed Bangla font in my Mac Book Pro. After installation, Bangla font is working fine Chrome browser but it sets default language to Bangla. I have tried to changed the default language from Chrome browser language settings option (chrome://chrome/settings/languages). But this is not working for me.

Chrome language settings option

Chrome language settings option

Also I had some problem with Bangla font in Firefox browser.

After investing some times on web I found the solution on Google forum (!category-topic/chrome/discuss-chrome/ROpLFRqGpfI)

1. Go to Sytem Preferences
2. Language and Text
3. Drag the “English” to the top of the list

This is also resolve my Firefox issue 🙂

1 Comment

Posted by on May 31, 2012 in Uncategorized


Tags: , , ,

Protect website with htpasswd and htaccess

Sometimes we need to protect our website or website directories with username and password while we are working on development server. Password protect one or more directories with Basic HTTP Authentication using .htaccess. A .htpasswd file will be used to store login details.

Add following code into your .htaccess file

AuthType Basic
AuthName “My Protected Area”
AuthUserFile /path/to/.htpasswd
Require valid-user

Auth name: This name will be displayed in the login box when a user access your protected area for the first time.

AuthUserFile: you need to enter the full path of your .htpasswd file here. Use the following PHP script to find the full path of you .htpasswd file

$dir = dirname(__FILE__);
echo "<p>Full path to this dir: " . $dir . "</p>";
echo "<p>Full path to a .htpasswd file in this dir: " . $dir . "/.htpasswd" . "</p>";
Leave a comment

Posted by on May 28, 2012 in Uncategorized


Tags: , , ,

How to increase java heap space for eclipse in mac

This is not so tough to increase your java heap space for eclipse in mac though this is not too easy like windows :). Here is the steps you should follow to increase your java heap space

  • Go to Eclipse installation folder
  • Click right button on file and select “Show Package Content”
java heap space for eclipse

java heap space for eclipse 1

  • Navigate to eclipse.ini file from Contents > MacOS > eclipse.ini
  • Open eclipse.ini file with Text editor
  • Increase the memory limit (see image below) and save the file
java heap space for eclipse

java heap space for eclipse

  • Restart your eclipse and see the difference.
1 Comment

Posted by on May 6, 2012 in Uncategorized


Tags: , ,

How to get Longitude and Latitude from Address using PHP

Couple of days ago I have worked with Google Map to do search pharmacy. Basically requirement is, user will search with zip code and the result will display all the pharmacy with a certain radius of the zip code. After doing some research I found, this can be search with with latitude and longitude (I won’t discus about this today, I will write about this in another post). Entering latitude and longitude by the user won’t be a smart application, so I plan to get the latitude an longitude from the given address.

Google provide example to identify latitude and longitude from address with JavaScript. But I need it from PHP code. After spending some time on Google I found the solution 🙂

Here I am going to find latitude and longitude of my current office


$output= json_decode($jsondata);

$latitude = $output->results[0]->geometry->location->lat;
$longitude = $output->results[0]->geometry->location->lng;

echo “Latitude : “.$lat;
echo “Longitude : “.$long;

My example for JSON data. To get XML data, you just need to use xml instead of json. Do not use any space in address parameter, just use plus (+) sign here.

For more details visit this page The Google Geocoding API

Leave a comment

Posted by on May 3, 2012 in Uncategorized


Tags: , , ,

How to install or enable UNICODE on Xampp

Please follow the following steps to enable or install

  • Go to phpmyadmin (for localhost – http://localhost/phpmyadmin)
  • Select the database which you want to give UNICODE support
  • Select “Operations” tab from the top
  • Change the Collation from latin1_danish_ci to utf8_general_ci
  • That’s it… your database now UNICODE supported

Note: Moodle database require UNICODE support.


Posted by on May 1, 2012 in Uncategorized


Tags: , ,