title: create custom registration form with conatct info and comapny info Magento
body: <p>Hi friends i am not expert in <strong>magento</strong> but i have some good knowledge of its themng but i dont have a very good knowledge of modules , i need to <strong>create</strong> a </p>
  
  <blockquote>
    <p>custom registration form with contact info and company info</p>
  </blockquote>
  
  <p>details , </p>
  
  <blockquote>
    <p>i need to create this on my own custom page , i need the magento
    default registration page also</p>
  </blockquote>
  
  <p>, i have check the </p>
  
  <pre><code>app\code\core\Mage\Customer\controllers/AccountController  
  </code></pre>
  
  <p>in which i got the </p>
  
  <pre><code>public function createPostAction()
      {
          $session = $this-&gt;_getSession();
          if ($session-&gt;isLoggedIn()) {
              $this-&gt;_redirect('*/*/');
              return;
          }
          $session-&gt;setEscapeMessages(true); // prevent XSS injection in user input
          if ($this-&gt;getRequest()-&gt;isPost()) {
              $errors = array();
  
              if (!$customer = Mage::registry('current_customer')) {
                  $customer = Mage::getModel('customer/customer')-&gt;setId(null);
              }
  
              /* @var $customerForm Mage_Customer_Model_Form */
              $customerForm = Mage::getModel('customer/form');
              $customerForm-&gt;setFormCode('customer_account_create')
                  -&gt;setEntity($customer);
  
              $customerData = $customerForm-&gt;extractData($this-&gt;getRequest());
  
              if ($this-&gt;getRequest()-&gt;getParam('is_subscribed', false)) {
                  $customer-&gt;setIsSubscribed(1);
              }
  
              /**
               * Initialize customer group id
               */
              $customer-&gt;getGroupId();
  
              if ($this-&gt;getRequest()-&gt;getPost('create_address')) {
                  /* @var $address Mage_Customer_Model_Address */
                  $address = Mage::getModel('customer/address');
                  /* @var $addressForm Mage_Customer_Model_Form */
                  $addressForm = Mage::getModel('customer/form');
                  $addressForm-&gt;setFormCode('customer_register_address')
                      -&gt;setEntity($address);
  
                  $addressData    = $addressForm-&gt;extractData($this-&gt;getRequest(), 'address', false);
                  $addressErrors  = $addressForm-&gt;validateData($addressData);
                  if ($addressErrors === true) {
                      $address-&gt;setId(null)
                          -&gt;setIsDefaultBilling($this-&gt;getRequest()-&gt;getParam('default_billing', false))
                          -&gt;setIsDefaultShipping($this-&gt;getRequest()-&gt;getParam('default_shipping', false));
                      $addressForm-&gt;compactData($addressData);
                      $customer-&gt;addAddress($address);
  
                      $addressErrors = $address-&gt;validate();
                      if (is_array($addressErrors)) {
                          $errors = array_merge($errors, $addressErrors);
                      }
                  } else {
                      $errors = array_merge($errors, $addressErrors);
                  }
              }
  
              try {
                  $customerErrors = $customerForm-&gt;validateData($customerData);
                  if ($customerErrors !== true) {
                      $errors = array_merge($customerErrors, $errors);
                  } else {
                      $customerForm-&gt;compactData($customerData);
                      $customer-&gt;setPassword($this-&gt;getRequest()-&gt;getPost('password'));
                      $customer-&gt;setConfirmation($this-&gt;getRequest()-&gt;getPost('confirmation'));
                      $customerErrors = $customer-&gt;validate();
                      if (is_array($customerErrors)) {
                          $errors = array_merge($customerErrors, $errors);
                      }
                  }
  
                  $validationResult = count($errors) == 0;
  
                  if (true === $validationResult) {
                      $customer-&gt;save();
  
                      Mage::dispatchEvent('customer_register_success',
                          array('account_controller' =&gt; $this, 'customer' =&gt; $customer)
                      );
  
                      if ($customer-&gt;isConfirmationRequired()) {
                          $customer-&gt;sendNewAccountEmail(
                              'confirmation',
                              $session-&gt;getBeforeAuthUrl(),
                              Mage::app()-&gt;getStore()-&gt;getId()
                          );
                          $session-&gt;addSuccess($this-&gt;__('Account confirmation is required. Please, check your email for the confirmation link. To resend the confirmation email please &lt;a href="%s"&gt;click here&lt;/a&gt;.', Mage::helper('customer')-&gt;getEmailConfirmationUrl($customer-&gt;getEmail())));
                          $this-&gt;_redirectSuccess(Mage::getUrl('*/*/index', array('_secure'=&gt;true)));
                          return;
                      } else {
                          $session-&gt;setCustomerAsLoggedIn($customer);
                          $url = $this-&gt;_welcomeCustomer($customer);
                          $this-&gt;_redirectSuccess($url);
                          return;
                      }
                  } else {
                      $session-&gt;setCustomerFormData($this-&gt;getRequest()-&gt;getPost());
                      if (is_array($errors)) {
                          foreach ($errors as $errorMessage) {
                              $session-&gt;addError($errorMessage);
                          }
                      } else {
                          $session-&gt;addError($this-&gt;__('Invalid customer data'));
                      }
                  }
              } catch (Mage_Core_Exception $e) {
                  $session-&gt;setCustomerFormData($this-&gt;getRequest()-&gt;getPost());
                  if ($e-&gt;getCode() === Mage_Customer_Model_Customer::EXCEPTION_EMAIL_EXISTS) {
                      $url = Mage::getUrl('customer/account/forgotpassword');
                      $message = $this-&gt;__('There is already an account with this email address. If you are sure that it is your email address, &lt;a href="%s"&gt;click here&lt;/a&gt; to get your password and access your account.', $url);
                      $session-&gt;setEscapeMessages(false);
                  } else {
                      $message = $e-&gt;getMessage();
                  }
                  $session-&gt;addError($message);
              } catch (Exception $e) {
                  $session-&gt;setCustomerFormData($this-&gt;getRequest()-&gt;getPost())
                      -&gt;addException($e, $this-&gt;__('Cannot save the customer.'));
              }
          }
  
          $this-&gt;_redirectError(Mage::getUrl('*/*/create', array('_secure' =&gt; true)));
      }
  </code></pre>
  
  <blockquote>
    <p>which is for creating new account</p>
  </blockquote>
  
  <p>, </p>
  
  <blockquote>
    <p>but i don't want to edit this function because i need the magento
    default registration page als</p>
  </blockquote>
  
  <p>o , <strong>so please suggest me how can i create a new function from where i can make the customer provide there information and can register and i can store that in database , basically i need to store the contact info and company info in address tables so that the information can be shown in admin</strong> </p>