Get ID from a URL in drupal? I have cretad a menu for edit a form in drupal...

Code:

function pricepackages_menu()
{
    $items = array();
    $items['membership/packages'] = array(
        'title' =&gt; t('Add Membership Packages'),
        'page callback' =&gt; 'drupal_get_form',
        'page arguments' =&gt; array('pricepackages_form'),
        'access arguments' =&gt; array('access administration pages'),
    );
    $items['show/packages'] = array(
        'title' =&gt; t('Manage Membership Packages'),
        'page callback' =&gt; 'view_packages',
        'access arguments' =&gt; array('access administration pages'),
    );
    $items['package/%/edit'] = array(
        'title' =&gt; 'Edit Membership',
        'page callback' =&gt; 'drupal_get_form',
        'page arguments' =&gt; array('pricepackages_form_update'),
        'access arguments' =&gt; array('access administration pages'),
    );
    return $items;
}


3rd menu is for eidt purpose...

The codd to show form i worte is:

function pricepackages_form_update($form, &amp;$form_state)
{
    $form['packagename'] = array(
        '#type' =&gt; 'textfield',
        '#title' =&gt; 'Package Name',
        '#required' =&gt; TRUE,
    );
}


Please let me know how can get the value of the id in the url :

URL :  http://somedomain.com/package/1/edit

I want to get the id 1 from the url and than want to add a select query... please let me know how can i get that value so i can wrote teh select query...

Also do i have to specify a new parameter in the pricepackages_form_update() or not?

Thanks in advance...
Try It works for me.    

$items['package/%/edit'] = array(
'title' =&gt; 'Edit data Row',
'page callback' =&gt; 'pricepackages_form_update',
'page arguments' =&gt;array(1),
'type' =&gt; MENU_NORMAL_ITEM,
'access callback' =&gt; TRUE,
);


function pricepackages_form_update($arg){
$my_object = db_select('your table name', 'a')
-&gt;fields('a')
-&gt;condition('your node id parameter', $arg )
-&gt;execute()
-&gt;fetchAssoc();
return drupal_get_form('your form menu', $my_object);
}