Theming the user registration form in Drupal 6

What theming function to override...?

So, now, you want to theme the register form. That's your goal. The first question you ask yourself is What theming function must I intercept and override?

To find answers to these types of questions, IMRI.in recommends using the module Theme Developer.

Download the Devel set of modules from Drupal.org, extract it to sites/all/modules, and enable the Devel module on your admin/build/modules page.

Registering a theming function

To register a theming function for a form, you must know its Form ID.

There are at least two ways to find the Form ID.

* Look at the CSS id. That id is the hyphenated version of the Form ID: . Hence, the Form ID, here, is user_register.
* Look at some hidden input in the form markup with name "form_id". The value of that input is the Form ID: me="form_id" id="edit-user-register" value="user_register" type="hidden">

here your FORMID is user_register

Registering a theming function for a form

STEP-1

You open your theme's template.php file. imri.in using the Garland theme. Here's the code to register a theming function for the 'user_register' form:
instead of garland name you need to put your theme name that you are using

<?php
/* Register some theme functions for forms, theme functions
* that have not been registered by the module that created
* them...
*/
function garland_theme(){
return array(
'user_register' => array(
'arguments' => array('form' => NULL),
// and if I use a template file, ie: user-register.tpl.php
'template' => 'user-register',
),
);
}
?>

STEP-2

Create a file called user-register.tpl.php in your theme folder. In it, place this markup:
Hello world

<?php print $form_markup; ?>

STEP-3

Then, create the skeleton for the template preprocess function in your template.php (theme folder)file like so:

<?php
function garland_preprocess_user_register(&$vars) {
// That's where $form_markup is created
$vars['form_markup'] = drupal_render($vars['form']);
}
?>

The function garland_preprocess_user_register(), as defined above, creates a new variable and passes it to the template file. That new variable is $form_markup, and it contains the markup for the form 'user_register'.

STEP-4
After that go to administer/perfomance and clear the cache and refresh the page .
After doing this go to user registration page and check the output
it will display hello world on the top of username field.
you can create your own page by putting form coding in the user_registration page