Obtaining the node type being added with php
If you are changing the form used to create a node, then you could use the following code. 

function mymodule_form_node_form_alter(&amp;$form, &amp;$form_state) {
  $node = $form_state['node'];
  if (!isset($node-&gt;nid) || isset($node-&gt;is_new)) {
    // The node is being created.
    // Use $node-&gt;type to get the content type of the node.
  }
}


The reason is that node_add(), the page callback for the node creation form, contains the following code.

  $types = node_type_get_types();
  $node = (object) array(
    'uid' =&gt; $user-&gt;uid,
    'name' =&gt; (isset($user-&gt;name) ? $user-&gt;name : ''),
    'type' =&gt; $type,
    'language' =&gt; LANGUAGE_NONE,
  );
  drupal_set_title(t('Create @name', array('@name' =&gt; $types[$type]-&gt;name)), PASS_THROUGH);
  $output = drupal_get_form($type . '_node_form', $node);


This means that the form used when creating a node is the node edit form.

As alternative, if you need to change the node creating form when the content type is, for example, article, you can use the following code.

function mymodule_form_article_node_form_alter(&amp;$form, &amp;$form_state) {
  $node = $form_state['node'];
  if (!isset($node-&gt;nid) || isset($node-&gt;is_new)) {
    // The node is being created.
  }
}


As in this case the form is altered only when article is the content type of the node, you don't actually need to check the content type.

If you need that information in other cases, then you can only get it from the URL.