to get a post custom fields name you can use get_post_custom
eg:
$post_meta = get_post_custom($post->ID);
foreach ( $post_meta as $key => $value )
echo $key . " => " . $value . "<br />";
this will print a list of custom_field_name => custom_field_value