Encoding involves forming a memory code.
Generally, you need to pay attention to information if you intend to remember it.
Attention involves focusing awareness on a narrowed range of stimuli or events.
Selective attention is a term used by many psychologists to describe this paying-attention-to-something process; however, the word selective is really redundant. Attention IS selection of input.
Divided attention occurs when attention is focused on two or more inputs simultaneously. Divided attention can have a negative impact on the performance of a variety of tasks, especially those which are unfamiliar or complex (driving and talking on a cell phone doubles the chance of missing traffic signals and slows reaction time).