A: 

You could make use of the Profile module in the Core list of modules as well. It will solve this without any programming, fyi.

Kevin
yes the more I talk to people, the more they advise me to use that or the content module. Guess I jumped the gun by diving into code. Thanks for the tip though :)
+1  A: 

You just need a check for the current page, using either arg or $_GET['q'].

eg:

function special_registration_form_alter(&$form, $form_state, $form_id) {
if ($_GET['q'] !== 'whatever/path' ) { return false; }
..rest of code..
}
cam8001
Will this still work if you have clean URLS enabled?
Jergason
Yes, $_GET['q'] is always the system path, so for example if your nodes are aliased to '/blog/2010/Jan/title-of-blog-post.html' $_GET['q'] will still be 'node/123'.
cam8001
+2  A: 

If you want to restrict your form alterations to a specific page, you can simply add a check for the page to your form id check, e.g.:

function special_registration_form_alter(&$form, $form_state, $form_id) {
  // Alter the registration form, but only on 'user/register' pages
  if ($form_id == 'user_register' && 'user' == arg(0) && 'register' == arg(1)) {
    // snipped alteration code
  }
}
Henrik Opel
Ok, I didn't notice cam8001s similar answer in time - still leaving this version, as it combines the page and form id checks (no need to return FALSE, btw)
Henrik Opel
cam8001
A: 

Implement hook_user(); the function allow to alter the form presented to the users when they register on a site. hook_user() is used by user.module, and it is independent from the profile module.

Defining the hook as hook_user($op, &$edit, &$account, $category = NULL), the parameter $op will contain the value 'register' when the registration form is being presented to the user. In that case, the module returns the form fields it wants to add to the registration form.

kiamlaluno
A: 

If you don't really need to create user accounts, like for a simple event registration. If instead you're collecting just names, you could use the webform module instead.