writing form action path programmatically Here is a custom user login form by Overriding the template. But can't understand how to print the destination/action path on the form. here is my code:


  block--user--login.tpl.php


&lt;form accept-charset="UTF-8" id="user-login-form" method="post" action="/node?destination=node"&gt;
  &lt;div class="custom-form"&gt;
    &lt;div class="form-item form-type-textfield form-item-name"&gt;
  &lt;label for="edit-name"&gt;Username &lt;span title="This field is required." class="form-    required"&gt;*&lt;/span&gt;&lt;/label&gt;
  &lt;input type="text" class="form-text required" maxlength="60" size="15" value=""     name="name" id="edit-name"&gt;
&lt;/div&gt;

    &lt;div class="form-item form-type-password form-item-pass"&gt;
  &lt;label for="edit-pass"&gt;Password &lt;span title="This field is required." class="form-required"&gt;*&lt;/span&gt;&lt;/label&gt;
  &lt;input type="password" class="form-text required" maxlength="60" size="15" name="pass" id="edit-pass"&gt;
&lt;/div&gt;

&lt;div id="edit-actions" class="form-actions form-wrapper"&gt;
  &lt;input type="submit" class="form-submit" value="Log in" name="op" id="edit-submit"&gt;
&lt;/div&gt;

&lt;div class="item-list"&gt;
  &lt;ul&gt;
    &lt;li class="first"&gt;&lt;a title="Create a new user account." href="/user/register"&gt;Create new account&lt;/a&gt;&lt;/li&gt;
        &lt;li class="last"&gt;&lt;a title="Request new password via e-mail."     href="/user/password"&gt;Request new password&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
&lt;/div&gt;

&lt;input type="hidden" value="&lt;?php print $elements['form_build_id']['#value']; ?&gt; "     name="form_build_id"&gt;
    &lt;input type="hidden" value="user_login_block" name="form_id"&gt;
  &lt;/div&gt;
&lt;/form&gt;


Here we are using a default path like action="/node?destination=node" its really a bad idea..So i want to print the action path programmatically.. Any idea?
This maybe an idea: &lt;?php print $elements['actions']['#the_path']; ?&gt;
The action is stored in the form's #action property, so assuming your form is represented by the $elements variable in the template, something like this should do it:

&lt;form accept-charset="UTF-8" id="user-login-form" method="post" action="&lt;?php echo $elements['#action']; ?&gt;"&gt;