How to get url path info into a form variable I am creating a module for Drupal 7 that has form that will appear in a block. What I would like to do is get the url for the page that the block appears on (when displayed to the user) and store it in a hidden variable so that it can be processed later. Is this possible and how would you go about doing it?

Thanks
How to store the data depends on what you want to achieve with that data or how you want to process it afterwards. The easiest solution for that is probably using watchdog() after form submission:

watchdog('myblock', $url);


To get the current path there is current_path():

$url=current_path();


Please beware that you must disable caching for that block to have the code in your block processed all the time. Here is an answer on how to create a block programmatically in Drupal.