title: How to create custom block in Drupal 7?
body: <p>I want to create a custom block in which I want to show custom form.</p>
  
  <p>Form will contain only two element. </p>
  
  <ul>
  <li>input box (<code>#centimeter</code>) </li>
  <li>submit button</li>
  </ul>
  
  <p>When this submit button is clicked I want to convert this centimeter in inch and display the result below this form and I want to show this in block in sidebar.</p>
  
  <p>My questions:</p>
  
  <ol>
  <li>How to do this?</li>
  <li>I tried following link but don't know where to write the code - should I create any php file in some folder?</li>
  <li>What to do if I want to show this block as a page with some url like <code>/measurement/convert-cm-to-inches</code></li>
  </ol>
  
  <p><a href="http://kahthong.com/2013/06/create-your-own-custom-drupal-block-programmatically" rel="nofollow">http://kahthong.com/2013/06/create-your-own-custom-drupal-block-programmatically</a></p>