How to add a php to a custom page Here is what I am trying to do, I have a bookmarklet with the following code

javascript:location.href="http://mywebsite.com/getsource?url="+encodeURIComponent(location.href);


I want to fill in the url into a field on the page "http://mywebsite.com/getsource" 

After asking around a bit, I was provided this piece of code.

&lt;input type="text" id="edit-url-field" value="&lt;?php echo $_GET['url']; ?&gt;" /&gt;


My question is .. how do I implement this in Drupal 7?
You need to implement a custom module which defines a form and a path to this form.

In Drupal forms are implemented with the Form API. Please check this links for more information


http://drupal.org/node/751826
http://api.drupal.org/api/drupal/developer!topics!forms_api_reference.html/7


You can define the path by implementing hook_menu.