How to programmatically set node field values. I have a content type.  I have firstname, lastname and email address fields.  I need the default value for each field to be the firstname, lastname and email address of the user profile.  Also, I need to prevent the user from modifying these values. The user should be able to see the values by default, but the user shouldn't be able to edit them.
You can create a custom module and add use hook_form_alter to change the default_value of your field and change them to #disabled =&gt; true. Here is an example. Don't forget to chage modulename to the name of your module and form-id to the id of your form :-).

function modulename_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    global $user;
    if ($form['#id'] == 'form-id') {
        $form['field_name'] = array(
            '#disabled' =&gt; TRUE,
            '#default_value' =&gt; $user-&gt;name
        );
    }
}