How to print login form on page How to print login form with destination url on a page using code in drupal 7  ?
You can use below code to print login form block

&lt;?php
print(drupal_render(drupal_get_form('user_login_block')));
?&gt;


For login redirect to destination you can use Login Destination module

Project page says


  The Login Destination module allows you to customize the destination
  that a user is redirected to after logging in, registering to the site
  (7.x), using a one-time login link or logging out (7.x). The
  destination can be an internal page or an external URL. It is possible
  to specify certain conditions like referring pages or user roles and
  make the destination depend upon them. You may use PHP snippets to
  provide custom conditions and destinations. It is also possible to
  keep users on the currently visited page after logging in or out.