How to display one of Drupal's default forms I have a module that i want to use to display a modified version of one of Drupal 7's default forms. The form ID is user_profile_form and it is the form used to edit a user's account information.

So this is the structure of my module:


hook_menu with a page callback to a function --> user_exe_edit() -->
function user_exe_edit() calls drupal_get_form(input_simple_form) -->
function input_simple_form($form, &amp;$form_submit)


Now I need the function input_simple_form to return the Drupal form with id "'user_profile_form".

How do I do that?
user_profile_form() is an existing function, but it's not defined in a module file; that means that the file where the function is defined needs to first be loaded, in a way or the other.

Instead of defining a page callback that then calls drupal_get_form() to get a form defined in a form builder implemented in the same module, I would rather define the menu callback using the following code (the code I am writing is for Drupal 7, but can easily adopted for Drupal 6, if there is the need.

$items['path'] = array(
  'page callback' =&gt; 'drupal_get_form',
  'page arguments' =&gt; array('input_simple_form'),
  'file path' =&gt; drupal_get_path('module', 'user'),
  'file' =&gt; 'user.pages.inc',
);


The code for the form builder could be something similar to the following one:

function input_simple_form($form, &amp;$form_state) {
  $form = array_merge($form, drupal_get_form('user_profile_form', $account));
  // ...
}



user_profile_form() uses a third argument, the category of the profile to show. Its default value is "account"; if you are getting an error about a missing third argument, then you can explicitly pass that parameter too, for example using its default value, as in drupal_get_form('user_profile_form', $account, 'account').
"user.pages.inc" is the file containing the user_profile_form() form builder, in Drupal 7, and Drupal 6. The reason that you get the error you see is that such files are loaded only when Drupal is instructed to load them; that is done by using the "file" and "file path" array indexes. ("file path" is only required when the file is not between the files of the module implementing hook_menu().)
I used input_simple_form() as form builder, in the case you need to use its own validation and submission handlers.
There is a $account variable that has not been defined in the example code I wrote. That is one of the required arguments that user_profile_form() needs, as the function needs to know for which user account the form is being build. That is the other reason to use your own form builder, which should load the user object for the account used for the user profile form, or pass the value of the global $user to drupal_get_form('user_profile_form').