
Blocks in Drupal can be assigned to regions in specified pages. Two options which are already in Drupal 7's block configuration page are:
All pages except those listed
Only the listed pages
And if you have enabled the PHP filter module, you may find another option:
Pages on which this PHP code returns TRUE (experts only)
In this article,I am going to explain to you, how you can display a block on pages based on the value returned by PHP code.